On 10 March 2010 08:54, capsized <[email protected]> wrote:
> Hi,
>
> I have an application layout that is used to create the general layout
> for all pages.
> However, I seem to struggle to find out how to declare variables like
> arrays so that they are available everytime that layout or its related
> partials are used.
>
> Putting @myarray = MyArray.all into every action in every controller
> doesn't seem very dry, so I guess I'm just looking for a very simple
> straighforward convention, but can't seem to find it documented
> anywhere or figure it out.

If it is literally something as simple as MyArray.all I believe there
is nothing wrong with calling the model direct from the view.

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to