Joe
2009-Sep-24 18:11 UTC
Editing Tutorials Copy thread as the other one seems to have glitched
This was my post but the thread has glitched (to my understanding) so here it is again (please delete if the other one starts working..) .. Hi, Ive recently bene trying to find a way to edit my tutorials (which are stored inside categories) in my RoR app. To edit my category''s names I use the following in the category show file: <%= link_to ''Edit'', edit_category_path(@category) %> And this is edit in the categories controller: def edit @category = Category.find(params[:id]) end but when I change this to tutorials: <%= link_to ''Edit'', edit_tutorial_path(@tutorial) %> and def edit @tutorial = Tutorial.find(params[:id]) end I get this error on the tutorial show page: undefined method `edit_tutorial_path'' for #<ActionView::Base: 0x5ce52fc> (or something of those origins) I had the origional category system setup for me, so I dont know that much about how the categories are editable. Therefore its hard for me to figure out how to edit the tutorials. Please Help, (If you need any more information please just ask), Thanks In Advance, Joe
Ilan Berci
2009-Sep-24 18:17 UTC
Re: Editing Tutorials Copy thread as the other one seems to have glitched
Joe wrote:> > undefined method `edit_tutorial_path'' for #<ActionView::Base: > 0x5ce52fc> > > (or something of those origins)> Thanks In Advance, > > > Joecheck out your routes file .. config/routes.rb and then possibly google "restful routing rails" if you are still stuck hth ilan -- Posted via http://www.ruby-forum.com/.