Rails 4 before_action, pass parameters to invoked method
before_action only: [:show, :edit, :update, :destroy] do
set_support("value")
end
A short and one-liner answer (which I personally prefer for callbacks) is:
before_action except:[:index, :show] { method :param1, :param2 }
Another example:
after_filter only:[:destroy, :kerplode] { method2_namey_name(p1, p2) }
You can use a lambda:
class SupportsController < ApplicationController
before_action -> { set_support("value") },
only: [:show, :edit, :update, :destroy]
...