I try to structure my rails application with modules, but i have problems to define the routes. Is'' it possible to use someting like this: <%= link to ''...'', :module => :module_name, :controller => :ctrl_name [...] -%> ? The controllers i want to access are in app/controllers/module_name. I thougt i could define something like this: map.connect '':module/:controller/:action'', but it doesn''t work. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You could try to namespace them instead of wrapping multiple controllers in a module if that is an option. script/generate controller admin/messages script/generate controller admin/users Fredrik On Apr 30, 11:55 am, r3dcaps <redc...-hi6Y0CQ0nG0@public.gmane.org> wrote:> I try to structure my rails application with modules, but i have > problems to define the routes. Is'' it possible to use someting like > this: <%= link to ''...'', :module => :module_name, :controller > => :ctrl_name [...] -%> ? > > The controllers i want to access are in app/controllers/module_name. I > thougt i could define something like this: map.connect > '':module/:controller/:action'', but it doesn''t work.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
But this has the same effect like "script/generate Admin::Messages" the class that will be created is in the module Admin. This is not a problem for me, but how do i create links to the modules. Is it posible to route requests in a default folder? For example: controllers/admin controllers/customers controllers/public are my differnt interfaces, by default the controllers in public should serve the users request, so that the url is somthing like: http://url/controller/action and not http://url/subfolder/controller/action. On Apr 30, 8:50 pm, Fredrik <fredrik.thures...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You could try to namespace them instead of wrapping multiple > controllers in a module if that is an option. > > script/generate controller admin/messages > script/generate controller admin/users > > Fredrik > > On Apr 30, 11:55 am, r3dcaps <redc...-hi6Y0CQ0nG0@public.gmane.org> wrote: > > > I try to structure myrailsapplication with modules, but i have > > problems to define the routes. Is'' it possible to use someting like > > this: <%= link to ''...'', :module => :module_name, :controller > > => :ctrl_name [...] -%> ? > > > The controllers i want to access are in app/controllers/module_name. I > > thougt i could define something like this: map.connect > > '':module/:controller/:action'', but it doesn''t work.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---