Allen Walker
2008-Aug-01 03:29 UTC
[Facebooker-talk] question about defining actions in controllers
I''m trying to had a new action to my "actitivites" controller. activities_controller.rb ... def view ... end ... ------------- When I try to access the following URL: http://apps.new.facebook.com/myapp/activities/view it returns: Unknown action No action responded to show -------------- Also the following "link_to" breaks: link_to("Attendees:", activities_path(:id => activity, :controller => :activities, :action => :view))%> with error: ActionController::RoutingError in Public#index Showing /public/index.fbml.erb/ where line *#25* raised: ActionView::TemplateError (activities_url failed to generate from {:controller=>"activities", :action=>"view", :id=>#<Activity id: 60..... ----- my routes.db: .. map.resources :activities .. ----- I seem to not be able to specify create "actions" that can be accessed thru my controller. I think there is something I''m missing here. Thanks
Allen Walker
2008-Aug-01 03:37 UTC
[Facebooker-talk] question about defining actions in controllers
BTW the following works: http://apps.new.facebook.com/myapp/activities/view/1 I guess the question is, why is the "link_to" operation generating the url incorrectly it''s doing something like http://apps.new.facebook.com/myapp/activities/view?id=2 which is causing a routing issue. Allen Walker wrote:> I''m trying to had a new action to my "actitivites" controller. > > activities_controller.rb > > ... > > def view > ... > end > > ... > ------------- > > When I try to access the following URL: > http://apps.new.facebook.com/myapp/activities/view > > it returns: > > > Unknown action > > No action responded to show > > -------------- > > Also the following "link_to" breaks: > > link_to("Attendees:", activities_path(:id => activity, :controller => > :activities, :action => :view))%> > > with error: > > > ActionController::RoutingError in Public#index > > Showing /public/index.fbml.erb/ where line *#25* raised: > > > ActionView::TemplateError (activities_url failed to generate from > {:controller=>"activities", :action=>"view", :id=>#<Activity id: 60..... > > ----- > > my routes.db: > .. > map.resources :activities > .. > > ----- > > I seem to not be able to specify create "actions" that can be accessed > thru my controller. I think there is something I''m missing here. > > Thanks > > >