Hello,
Why is this code causing the following error:
can’t convert nil into String
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection
for details
def current_site
return @site if defined?(@site)
@site = Site.find_by_domain(request.domain)
end
end
if I remove this line:
@site = Site.find_by_domain(request.domain)
The error will dissapear.
Any idea what am I doing wrong?
Many thanks for help!