# Basic ruby inheritance question

**URL:** <https://www.ruby-forum.com/t/basic-ruby-inheritance-question/115046>\
**Category:** Rails\
**Created:** [September 20, 2007, 3:24am UTC](https://www.ruby-forum.com/t/basic-ruby-inheritance-question/115046 "2007-09-20T03:24:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnstevenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Post date:** [September 20, 2007, 3:24am UTC](https://www.ruby-forum.com/t/basic-ruby-inheritance-question/115046/1 "2007-09-20T03:24:54Z")

</div>

I had a question over at the active scaffold forum no one was biting  
on so I thought I’d try here. In the example below the  
create\_authorized? is called by active scaffold to determine if links  
should display in the ui.

This example works as I expect:

class FooController \< ApplicationController  
  
def create\_authorized?  
authorized?(‘create’)  
end  
end

but if I try to move this method to ApplicationController like shown  
below the method is not called:

class ApplicationController \< ActionController::Base  
  
def create\_authorized?  
authorized?(‘create’)  
end  
end

Maybe if I understood more how ruby/oop works, I could figure this  
out. Can anyone tell me how this is possible.

---

<div class="post-metadata">

**Author:** ![dnstevenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Post date:** [September 20, 2007, 4:41am UTC](https://www.ruby-forum.com/t/basic-ruby-inheritance-question/115046/2 "2007-09-20T04:41:01Z")

</div>

is it accidentally under a private declaration in  
ApplicationController?

---

<div class="post-metadata">

**Author:** ![dnstevenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8dc957/32.png) [@dnstevenson](https://www.ruby-forum.com/u/dnstevenson)\
**Post date:** [September 20, 2007, 5:36am UTC](https://www.ruby-forum.com/t/basic-ruby-inheritance-question/115046/3 "2007-09-20T05:36:05Z")

</div>

good thought, but I tried the following, which should prove that out,  
no?

class ApplicationController \< ActionController::Base  
  
protected  
def create\_authorized?  
authorized?(‘create’)  
end  
end
