# Application scope question

**URL:** <https://www.ruby-forum.com/t/application-scope-question/122233>\
**Category:** Rails\
**Created:** [December 5, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/application-scope-question/122233 "2007-12-05T20:15:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdellaringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@tdellaringa](https://www.ruby-forum.com/u/tdellaringa)\
**Post date:** [December 5, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/application-scope-question/122233/1 "2007-12-05T20:15:06Z")

</div>

Getting into the later chapters of the Agile book depot app (and getting  
more confused as it goes along!) Boy for awhile I thought I was really  
getting it, now I’m not so sure.

Anyway, Chapter 11, talking about limiting access to admins. They have  
you create a filter (something I am fuzzy on understanding) that calls  
an authorize method. This method is placed inside the application  
controller, I think so all the other controllers can access it.

Now, here’s the part that really has me confused. He states “we need to  
restrict access to this method (the authorize filter) because the  
methods in application.rb appear as instance methods in all our  
controllers. Any public methods here are exposed to end users as  
actions.”

So he marks the filter as private.

Ok - then in the next line we go and add this authorize filter in the  
admin\_controller.rb. But - how does it even see this method in the  
application.rb if it is a private method? He just stated he put private  
so instance methods would not be visible in the controllers.

I believe I am mixing up some terminology here - possibly instance  
method vs. action? I’m really confused here though, so any tips are  
appreciated.

---

<div class="post-metadata">

**Author:** ![tdellaringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@tdellaringa](https://www.ruby-forum.com/u/tdellaringa)\
**Post date:** [December 6, 2007, 7:03am UTC](https://www.ruby-forum.com/t/application-scope-question/122233/2 "2007-12-06T07:03:02Z")

</div>

Hi,

On Dec 5, 2007 2:15 PM, Tom D.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Now, here’s the part that really has me confused. He states "we need to  
> so instance methods would not be visible in the controllers.
> 
> I believe I am mixing up some terminology here - possibly instance  
> method vs. action? I’m really confused here though, so any tips are  
> appreciated.

Check these links for more information on Ruby’s method visibility.

[http://weblog.jamisbuck.org/2007/2/23/method-visibility-in-ruby](http://weblog.jamisbuck.org/2007/2/23/method-visibility-in-ruby)  
[http://blog.zerosum.org/2007/11/22/ruby-method-visibility](http://blog.zerosum.org/2007/11/22/ruby-method-visibility)

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> > 
> 
> HTH,  
> Michael G.
