I’m trying to configure devise emails sent to be valid for a subdomain (by default all links point to main domain).
I’m following this:
https://github.com/plataformatec/devise/wiki/How-To%3A-Send-emails-from-subdomains
Problem is that I’m getting this error
NoMethodError in Devise/passwords#create
Showing /Users/user/Sites/site/app/views/devise/mailer/reset_password_instructions.html.haml where line #6 raised:
undefined method `subdomain' for #<User:0x007fb0019be868>
I’m calling subdomain from the view:
# app/views/devise/mailer/confirmation_instructions.html
%strong= link_to t('devise.confirmation_instructions.confirm_my_account'), confirmation_url(@resource, :confirmation_token => @resource.confirmation_token, :subdomain => @resource.subdomain)
Running Rails 3.2.3, devise 1.8.6
Solved by adding the subdomain in the environment config.