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
Editing Classified: <%= :title -%>
<% form_for :classified, :url => {:action => 'update'} do |form| %>Title
<%= form.text_field :title %>
price
<%= form.text_field :price %>
Location
<%= form.text_field :location %>
Description
<%= form.text_area :description %>
Email
<%= form.text_field :email %>
<%= submit_tag “save changes” %>
<% end %>
<%= link_to ‘Back’, {:action => ‘list’} %>
Help will be appreciated. Thanks