how to send instant variable from controller to methods after create in rails?
if i have controller like this :
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_url
def set_url
@url = if request.url.include?("http://localhost:3000/")
"http://localhost:3000"
else
"http://tester.com"
end
end
end
and i have model like this :
class Article < ActiveRecord::Base
after_create :get_url
def get_url
// how to get instant variable @url from before filter in application controller to this method ?
end
end
thanks before