title: Rails: When does methods mentioned in first line of the ControllerClass get executed?
body: <p>I come across methods calls, written in the ControllerClass Scope, something like (in <a href="https://github.com/kaminari/kaminari/issues/437#issuecomment-23948249" rel="nofollow noreferrer">here</a>):</p>
  
  <pre><code>class MoviesController &lt; ApplicationController
    # Is this a before_action or after_action or just an alias or something else?
    pagination_header :index                    # &lt;----- when will this be called
  
    def index
    # some logic here
    end
  
  end
  </code></pre>
  
  <p>When exactly are they executed, and how exactly are they internally bound <em>(are they callbacks attached to somewhere)</em> ?</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: I got to know that <code>pagination_header</code> is  a method that should execute just before the render method inside <code>index</code>. How is it possible to construct such a method?</p>
  
  <p>This is possible perhaps by including <code>after_action</code> inside <code>pagination_header</code> method, but how is it called just before render action, if its just a method call that would be executed only once when the class gets loaded?</p>