Topic: DRY Layout?


I have been following a couple of tutorials among them also this one

Although I feel I understood almost all of it something remains unclear:

Suppose I want to add a Top Menu to ALL views - do I add a line like this

  <%= render :partial => "shared/menu"  %>

to every *.html.erb?

Am I not repeating my self by doing so?

What is the dry way of doing that?


PS: wouldn't it be a nice idea to have a "Newbie Forum" for people like me? Or am i right posting here?

Re: DRY Layout?

If you want it to be at the top of every view, just put it in your application's layout view.

And yes, you're perfectly fine posting here. smile

Re: DRY Layout?

As danabrit pointed out, use your applications layout view. If it does not yet exist, then create the file app/views/layouts/application.html.erb and put your

 <%= render :partial => "shared/menu"  %>

in there.

Lead Developer of the WebNames Project and the wnrp:// protocol handler