Iam trying to build a classified site, I've created the code to add,edit,delete posts. I am facing trouble with the edit part. When I click the edit link for a post it shows the form with all the textfields,after entering in all the fields and clicking the save changes button, Iam getting the error: "Missing template classified/update.erb in view path app/view"
Update function in the controller looks like:
def update @classifed = Classified.find(params[:id]) if @classified.update_attributes(params[:classified]) redirect_to :action => 'show', :id => @classified else render :action => 'edit' end end
show.rhtml looks like
<h1>Editing Classified: <%= :title -%></h1> <% form_for :classified, :url => {:action => 'update'} do |form| %> <p><label for="classified_title">Title</label><br/> <%= form.text_field :title %></p> <p><label for="classified_price">price</label><br/> <%= form.text_field :price %></p> <p><label for ="classified_location">Location</label><br/> <%= form.text_field :location %></p> <p><label for ="classified_description">Description</label><br/> <%= form.text_area :description %></p> <p><label for ="classified_email">Email</label><br/> <%= form.text_field :email %></p>
<%= submit_tag "save changes" %> <% end %> <%= link_to 'Back', {:action => 'list'} %>
Help will be appreciated. Thanks