Displaying 1 result from an estimated 1 matches for "edit_post_url".
2007 Jul 31
0
Edit not working with named routes
...lter :login_required, :except => [:index, :show]
before_filter :find_post, :except => [:index, :new, :create]
def edit
end
def update
if @post.update_attributes(params[:post])
flash[:notice] = "Post Updated"
redirect_to post_url(@post)
else
render edit_post_url
end
end
protected
def find_post
@post = Post.find(params[:id])
end
end
Here is edit.hrtml
<h1>New Post</h1>
<% form_for(:post, @post, :url => post_url(@post), :html => {:method
=> ''put''}) do |f| %>
<%= render :partial => "...