Rails form helper and RESTful routes
- by Jimmy
Hey guys,
I have a form partial current setup like this to make new blog posts
<% form_for([@current_user, @post]) do |f| %>
This works great when editing a post, but when creating a new post I get the following error:
undefined method `user_posts_path' for #<ActionView::Base:0x6158104>
My routes are setup as follows:
map.resources :user do |user|
user.resources :post
end
Is there a better way to setup my partial to handle both new posts and editing current posts?