[Rails] Re: Link_to and Routing
dis guy wrote in post #1088404:
> This is what I see:
>
> new_parentitem_childitem GET
> /parentitems/:parentitem_id/childitems/new(.:format) childitems#new
>
>
>
> But this in my routes file doesn't work:
>
> match '/parentitems/:parentitem_id/childitems/new' => 'childitems#new'
Why are you now defining the routes using match?
Before you were using:
resources :parentitemsdo
resources :childitems, only: [:new, :create, :destroy]
end
For that new_parentitem_childitem_path should work for a link_to
Notice that resources :parentitemsdo should be resources :parentitems do
(I guess a space was missing before the do...)
-----
With the match way what does it mean it doesn't work anyway, what error
do you get?
Have you reviewed this guide? http://guides.rubyonrails.org/routing.html
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home