Last active
December 11, 2015 03:48
-
-
Save rmw/4540215 to your computer and use it in GitHub Desktop.
Railscast ActionController walkthrough
* Get class and module inheritance in rails
* Add middleware to controller
http://railscasts.com/episodes/395-action-controller-walkthrough
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ArticlesController < ApplicationController | |
| use Rack::ShowExceptions, only: :show | |
| # ... | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts ArticlesController.ancestors | |
| puts ArticlesController.ancestors - ArticlesController.included_methods # only inheritance chain | |
| ArticlesController.action(:index) # rack endpoint (can call .call(env) on it) | |
| ArticlesController.method(:action).source_location # where defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment