# instance method scope

**URL:** <https://discuss.rubyonrails.org/t/instance-method-scope/23809>\
**Category:** rubyonrails-talk\
**Created:** [January 24, 2008, 11:31pm UTC](https://discuss.rubyonrails.org/t/instance-method-scope/23809 "2008-01-24T23:31:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [January 24, 2008, 11:31pm UTC](https://discuss.rubyonrails.org/t/instance-method-scope/23809/1 "2008-01-24T23:31:31Z")

</div>

Hello, I am confused about the scope of the instance method "authenticated?" in the class shown below (it's defined in the application controller). It does not seem to be available in the block initialising my active scaffold but it is available inside the method "foo".

How can I gain access to the method in the initialisation block?

Many thanks!

class ItemController \< ApplicationController &nbsp;&nbsp;active\_scaffold :item do |config|

&nbsp;&nbsp;&nbsp;&nbsp;columns[:category].ui\_type = :select

&nbsp;&nbsp;&nbsp;&nbsp;if authenticated? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p "authenticated" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;config.label = "Manage Items" &nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p "not authenticated" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;config.label = "Search" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;config.list.columns = [:description, :address\_posttown] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;columns[:address\_posttown].label = "Town" &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;end

&nbsp;&nbsp;before\_filter :foo &nbsp;&nbsp;def foo &nbsp;&nbsp;&nbsp;&nbsp;if authenticated? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p "authenticated" &nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p "not authenticated" &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;end

end

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [January 25, 2008, 1:55pm UTC](https://discuss.rubyonrails.org/t/instance-method-scope/23809/2 "2008-01-25T13:55:00Z")

</div>

I misunderstood the initialisation order of classes vs instances but I understand that now 🙂
