Hello list!
I have a navigation bar where I want't to display the recently added members with a partial.
When I jump let's say to an action in the LinksController and render the partial it will
fail because the partial does not know about the Member model.
Where to put
def get_members
@members = Member.find(:all)
end
so the every partial can access it?
Thanx
Hello list!
I have a navigation bar where I want't to display the recently added
members with a partial.
When I jump let's say to an action in the LinksController and render
the partial it will
fail because the partial does not know about the Member model.
Where to put
def get_members
@members = Member.find(:all)
end
so the every partial can access it?
make it a before_filter
Thats's the way I did it ....
Let's say I have 10 controllers .. then I have to put it in there 10
times?
Is this correct?
I thought there might be a specail place to put.
Thanx
Hello list!
I have a navigation bar where I want't to display the recently added
members with a partial.
When I jump let's say to an action in the LinksController and render
the partial it will
fail because the partial does not know about the Member model.
Where to put
def get_members
@members = Member.find(:all)
end
so the every partial can access it?
make it a before_filter
Thats's the way I did it ....
Let's say I have 10 controllers .. then I have to put it in there 10
times?
Is this correct?
No - make it a before_filter in application.rb
Fred
Ok, thanx. That's what I was looking for. Great!!!