ruby on rails - Devise confirmation link is missing domain -


devise confirmation_url producing relative url no domain such as:

http://users/confirmation?confirmation_token=... 

i tried changing

confirmation_url(@resources, :confirmation_token => @resource.confirmation_token) 

to

confirmation_url(:confirmation_token => @resource.confirmation_token) 

but produces same url. upgraded devise 2.2.3 same outcome. rails 3.1.4

update: have set in production.rb:

  config.action_mailer.default_url_options = { :host => 'mysubdomain.mysite.com' }  

and tried setting

    before_filter set_actionmailer_host      def set_actionmailer_host       actionmailer::base.default_url_options[:host] = request.host_with_port     end 

to no avail in application controller (https://github.com/plataformatec/devise/issues/1567)

update: occurs in both development , production.

update can't understand why devise isn't using template in app/views/devise/mailer/confirmation_instructions.html.haml if edit append host manually: 'http://mysite.com/' + confirmation_url(... tried setting scoped views setting didn't have effect disaster, users can't confirm registration :(

you might have missed add default url hosts environment config-files. when run rails g devise:install command receive instructions.

# config/environments/development.rb  # default actiomailer url host (required devise)  config.action_mailer.default_url_options = { host: 'myapp.dev' } 

you need setting environments.

# config/environments/production.rb  # default actiomailer url host (required devise)  config.action_mailer.default_url_options = { host: 'myproductionapp.com' } 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -