Add before_filter method to end of list in rails 3

I have a before_filter: method in my application_controller and I want this method to run after the before_filter methods in the inherit class.

How can i do this?

Example

class ApplicationController < ActionController::Base protect_from_forgery before_filter :run_second end class SessionsController < ApplicationController before_filter :run_first end 
+6
source share
1 answer

I think the most convenient way for Rails would be to use prepend_before_filter in your SessionController:

 class SessionsController < ApplicationController prepend_before_filter :run_first end 
+6
source

Source: https://habr.com/ru/post/890832/


All Articles