Heinz Strunk
2011-Nov-22 17:39 UTC
Path helper doesn''t get object''s id automatically anymore?
Hey, for some reason my admin_club_path(club) doesn''t work anymore but only admin_club_path(club.id). Anyone know what the reason could be? This is the error message: No route matches {:action=>"show", :controller=>"admin/clubs", :id=>#<Club id: 98, name: "1. FSV Mainz 05 II", image: "mainz05.gif", photo_id: 3, league_id: 5, approved: false, permalink: "1-fsv-mainz-05-ii", created_at: "2011-11-22 16:43:13", updated_at: "2011-11-22 16:43:13">} Apparently it takes the whoe object as id but why? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Heinz Strunk
2011-Nov-24 08:52 UTC
Re: Path helper doesn''t get object''s id automatically anymore?
No one? I''m kinda stuck here... -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
島 涼平
2011-Nov-24 09:53 UTC
Re: Path helper doesn''t get object''s id automatically anymore?
hi. did you try "rake routes"? (2011/11/23 2:39), Heinz Strunk wrote:> Hey, > > for some reason my admin_club_path(club) doesn''t work anymore but only > admin_club_path(club.id). Anyone know what the reason could be? > > This is the error message: > No route matches {:action=>"show", :controller=>"admin/clubs", > :id=>#<Club id: 98, name: "1. FSV Mainz 05 II", image: "mainz05.gif", > photo_id: 3, league_id: 5, approved: false, permalink: > "1-fsv-mainz-05-ii", created_at: "2011-11-22 16:43:13", updated_at: > "2011-11-22 16:43:13">} > > Apparently it takes the whoe object as id but why? >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Heinz Strunk
2011-Nov-25 12:36 UTC
Re: Path helper doesn''t get object''s id automatically anymore?
Yes, routes are there: admin_clubs GET /admin/clubs(.:format) {:action=>"index", :controller=>"admin/clubs"} POST /admin/clubs(.:format) {:action=>"create", :controller=>"admin/clubs"} new_admin_club GET /admin/clubs/new(.:format) {:action=>"new", :controller=>"admin/clubs"} edit_admin_club GET /admin/clubs/:id/edit(.:format) {:action=>"edit", :controller=>"admin/clubs"} admin_club GET /admin/clubs/:id(.:format) {:action=>"show", :controller=>"admin/clubs"} PUT /admin/clubs/:id(.:format) {:action=>"update", :controller=>"admin/clubs"} DELETE /admin/clubs/:id(.:format) {:action=>"destroy", :controller=>"admin/clubs"} club GET /clubs/:id(.:format) {:action=>"show", :controller=>"clubs"} The problem is that admin_club_path(club) doesn''t work but admin_club_path(club.id) does. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.