I am using Ruby on Rails 3 and I am trying to use middlewares in order to set a variable @variable_name
accessible later in controllers.
For example my midd
I don't know if this can be done with a Middelware. My suggestion would be this:
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_my_var
private
def set_my_var
@account ||= Account.find(1)
end
end
This way all your controllers and views have access to @account