Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ApplicationController < ActionController::Base
- # this is sufficient
- def base_url1
- request.base_url
- end
- # if for some reason you insist on using global variable, than at least use it on subsequent calls to method
- def base_url2
- $base_url ||= request.base_url
- end
- end
Add Comment
Please, Sign In to add comment