$request = request
When I write this in controller, it will work. But if i need this variable in Model or Application controller, How can i ?
I got it
class ApplicationController < ActionController::Base protect_from_forgery before_filter :beforeFilter def beforeFilter $request = request end end
Now we can use the $request global variable anywhere in the code