How do I link (with link_to) to a controller and action inside a subdirectory in controllers? I get an error saying "Unknown action. No action responded ....". And do I understand it correctly that I need to have a similar subdirectory in views as well? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pål Bergström wrote:> How do I link (with link_to) to a controller and action inside a > subdirectory in controllers? I get an error saying "Unknown action. No > action responded ....".link_to :controller => ''/admin/products'', :action => ''list''> And do I understand it correctly that I need to have a similar > subdirectory in views as well?That is correct. Note that the behavior seems to be generally discouraged as it has led to unpredictable behavior before. (Search the archives for relevant discussions.) - Roderick -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg wrote:> Pål Bergström wrote: >> How do I link (with link_to) to a controller and action inside a >> subdirectory in controllers? I get an error saying "Unknown action. No >> action responded ....". > > link_to :controller => ''/admin/products'', :action => ''list'' > >> And do I understand it correctly that I need to have a similar >> subdirectory in views as well? > > That is correct. > > Note that the behavior seems to be generally discouraged as it has led > to unpredictable behavior before. (Search the archives for relevant > discussions.) > > - RoderickThanks. Yes I''ve seen that after reading here. I think I''ll leave it as I had it with one level. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg wrote:> Note that the behavior seems to be generally discouraged as it has led > to unpredictable behavior before. (Search the archives for relevant > discussions.)What I don''t understand is how to deal with the public view and the admin part. Let''s say I have a users table. To that I have a user model. But what if I want to keep the user controller just for admin and another controller for login. Can I create what ever controllers I want but tell it to use a certain model? Or does it always have to have a correlation, name-wise? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pål Bergström wrote:> What I don''t understand is how to deal with the public view and the > admin part. Let''s say I have a users table. To that I have a user model. > But what if I want to keep the user controller just for admin and > another controller for login. Can I create what ever controllers I want > but tell it to use a certain model? Or does it always have to have a > correlation, name-wise?Every model is available in every controller. They''re not linked namewise. - Roderick -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---