Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyController < ActionController::Base
- before_filter :restrict_to_development, :only => [:user_report]
- def index
- ...
- end
- def user_report
- ...
- end
- protected
- # this method should be placed in ApplicationController
- def restrict_to_development
- head(:bad_request) unless RAILS_ENV == "development"
- end
- end
- class MyController < ActionController::Base
- if RAILS_ENV == "development"
- def index
- #...
- end
- end
- end
Add Comment
Please, Sign In to add comment