Ruby on Rails Friday, November 26, 2010

On 26 November 2010 12:04, MDM <don.mapp@gmail.com> wrote:
> I have several static files(pages), which are basically copies of my
> website pages source code, with the content changed.
> These files support my website, (keeping the same format) in various
> ways.
> For example the menu part is:-
>
> <body>
>
>        <div id="menu">
>
> <ul class="level1" id="root">
> etc
> etc. until
> </ul>
>        </div>
>
> Unfortunately every month or so my menu bar changes and I have to
> update each static file manually.
> As each of my static files have the same menu.
> Is it possible to have one menu file which can be updated and have the
> static files load them automatically.
> I plan to have several more static files. So this would be a great
> help if someone can suggest how to accomplish this.

I would recommend providing a 'main' controller (or whatever you want
to call it) that just serves up the effectively static pages.
Initially you can just put the html straight into each page.html.erb
and render them specifying no layout. Then you can refactor them and
use the rails capabilities of partials, helpers and so on to put your
re-usable menu into a partial to make life easy.

Colin

--
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@googlegroups.com.
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?hl=en.

No comments:

Post a Comment