Hi My Rails application is in fact a big application that includes many websites. I have splitted each website into a module (wich includes the differents controllers of each websites). Do you think it''s the best way to do this ? But I have a problem with layouts. I''d like to have a global layout for each website, and into each website to have a layout for all controllers. Is it possible to have a " module layout" ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ve another question: I ve read in the french version of "agile web developement with rails" that the default layout for controller "my_controller" is the file "my_controller_layout.rhtml" located in "views/layout" but I think the file must be named " my_controller.rhtml" ... is that correct ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I ll try to reply to me myself ;) I think it''s not possible to have a " module layout" so I tried this method: I have an application layout calling a partial format like this : <%= render(:partial => "shared/"+@website, :object => @content_for_layout)%> (website define the module (=website) of the controller of the action which must be rendered) With this trick I can have - an application format for all controllers of my applications - a "module partial format" for each modules (= each websites of my application) - a format for each actions Do you have a better way of doing this ? Thanks a lot Cédric H. wrote:> Hi > > My Rails application is in fact a big application that includes many > websites. > > I have splitted each website into a module (wich includes the > differents controllers of each websites). > > Do you think it''s the best way to do this ? > > But I have a problem with layouts. I''d like to have a global layout for > each website, and into each website to have a layout for all > controllers. > > Is it possible to have a " module layout" ?--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
If your controllers derive from application.rb then they share the application.rhtml layout. To have module level layouts you create a base_controller.rb in the module and derive all that modules controllers from base. In base you specify layout ''modulex'' to use the modulex.rhtml layout. However that overrides the use of application.rhtml layout --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---