Many of the screens in the app I''m working on are "portal" views with little sidebar nuggets of information from elsewhere in the app. I thought components would be perfect for that. For example for a summary of user activity I could render_component(:controller => ''user'', :action => ''stats_box'') or something similar. The problem is that I have my page''s standard header and footer in application.rhtml. When I render_component, it is rendered inside the application.rhtml template. Since that contains header and footer, I have nasty stuff like <html> and <head> in the middle of my page! Of course I can get rid of application.rhtml and put my header and footer in controller_name.rhtml or an explicit layout name but that seems to violate DRY. I must be missing something... any input appreciated! Thanks! -- 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 -~----------~----~----~----~------~----~------~--~---
Carl Johnson wrote:> The problem is that I have my page''s standard header and footer in > application.rhtml. When I render_component, it is rendered inside the > application.rhtml template. Since that contains header and footer, I > have nasty stuff like <html> and <head> in the middle of my page!Change the code so that that the component uses "nil" for the layout. Eric --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Change the code so that that the component uses "nil" for the layout.Ah thanks... I''ll give that a shot. Though now that I am learning more about displaying data from a bunch of different models, I think I am going to try to switch to shared partials. I''ll have to compile the data from the various sources all in one controller, but in the "rails way" I don''t think that can be helped... -- 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 -~----------~----~----~----~------~----~------~--~---