Including custom files

I understand RoR better and better.:slight_smile: Particularly since I read “Mr.
Neighborly’s Ruby and Rails” (which I can recommend to newbies like me).
But a few questions:

I want to have a dynamic menu, displayed depending on group belonging,
included in my layout. I guess I can make a separate file and use to include it. Where do I keep that file in the system, does
it matter (I guess in views)? And will it include variables and such in
the main file â?? but also deal with var set previously in the main file?
Should I use .rb or .rhtml?

I plan to do the same thing with a header, and check if a session is set
or else the viewer will be redirected to the “front door”. Is this ok?
If I understand it correctly I can just put that in the layout-file.

Lastly, can I make a model of my own, described in book mentioned above,
instead of an included file? If so where do I keep that?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs