I''m using a custom header in my views (my client''s logo and some nav stuff) and I''m finding myself adding a render partial _header to every view... that''s not exactly putting my code in exactly one place -- am I missing something? Is there a way to define a custom header that all of the views end up using without having to explicitly put it in each view? I know, it''s only a line of code, but it''s annoying to have to do it in so many places... thanks!
Steve Enzer wrote:> I''m using a custom header in my views (my client''s logo and some nav > stuff) and I''m finding myself adding a render partial _header to every > view... that''s not exactly putting my code in exactly one place -- am I > missing something? Is there a way to define a custom header that all of > the views end up using without having to explicitly put it in each view? I > know, it''s only a line of code, but it''s annoying to have to do it in so > many places... thanks!Is there some reason it can''t go in the layout? -- Alex
On 10/7/05, Steve Enzer <steve-FtRd2ailaZWVuoF9d8nMAg@public.gmane.org> wrote:> I''m using a custom header in my views (my client''s logo and some nav > stuff) and I''m finding myself adding a render partial _header to every > view... that''s not exactly putting my code in exactly one place -- am I > missing something? Is there a way to define a custom header that all of > the views end up using without having to explicitly put it in each view? I > know, it''s only a line of code, but it''s annoying to have to do it in so > many places... thanks!you are looking for layouts http://api.rubyonrails.com/classes/ActionController/Layout/ClassMethods.html aren''t you ? jean
Put it in the layout. :-) -- -- Tom Mornini On Oct 7, 2005, at 9:16 AM, Steve Enzer wrote:> I''m using a custom header in my views (my client''s logo and some nav > stuff) and I''m finding myself adding a render partial _header to every > view... that''s not exactly putting my code in exactly one place -- > am I > missing something? Is there a way to define a custom header that > all of > the views end up using without having to explicitly put it in each > view? I > know, it''s only a line of code, but it''s annoying to have to do it > in so > many places... thanks! > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >