# Where to put my Member.find(:all)

**URL:** <https://www.ruby-forum.com/t/where-to-put-my-member-find-all/136000>\
**Category:** Rails\
**Created:** [April 27, 2008, 9:37pm UTC](https://www.ruby-forum.com/t/where-to-put-my-member-find-all/136000 "2008-04-27T21:37:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2008, 9:37pm UTC](https://www.ruby-forum.com/t/where-to-put-my-member-find-all/136000/1 "2008-04-27T21:37:10Z")

</div>

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

–  
Jochen

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/where-to-put-my-member-find-all/136000/2 "2008-04-27T21:45:04Z")

</div>

On 27 Apr 2008, at 20:36, Jochen kaechelin wrote:

> Where to put
> 
> def get\_members  
> @members = Member.find(:all)  
> end
> 
> so the every partial can access it?

make it a before\_filter

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2008, 9:54pm UTC](https://www.ruby-forum.com/t/where-to-put-my-member-find-all/136000/3 "2008-04-27T21:54:01Z")

</div>

On 27 Apr 2008, at 20:47, Jochen K. wrote:

> > > ```
> > > @members = Member.find(:all)
> > > 
> > > ```

No - make it a before\_filter in application.rb

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2008, 9:48pm UTC](https://www.ruby-forum.com/t/where-to-put-my-member-find-all/136000/4 "2008-04-27T21:48:38Z")

</div>

Am 27.04.2008 um 21:43 schrieb Frederick C.:

> > When I jump let’s say to an action in the LinksController and render
> 
> 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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 27, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/where-to-put-my-member-find-all/136000/5 "2008-04-27T21:55:48Z")

</div>

Am 27.04.2008 um 21:53 schrieb Frederick C.:

> > > On 27 Apr 2008, at 20:36, Jochen kaechelin wrote:
> > > 
> > > > the partial it will  
> > > > 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

Ok, thanx. That’s what I was looking for. Great!!!
