Thanks Scott, but you can also get solved this problem with putting here -
edit_password_url(@resource, :reset_password_token =>
@resource.reset_password_token, :protocol => "https")
this will only work perfectly
Thanks,
Hemant
On Friday, June 21, 2013 at 6:21:29 AM UTC+5:30, Scott Olmsted wrote:
>
> Thanks, guys, but I have now put :protocol => "https" in the url:
>
> %p= link_to 'Change my password', edit_password_url(@resource,
> :reset_password_token => @resource.reset_password_token, :protocol =>
> "https")
>
> and then in the production mailer configuration:
>
> config.action_mailer.default_url_options = { :host => '
> https://myapp.herokuapp.com', :protocol => 'https' }
>
> and then in both places at once, and every time the url generated has the
> protocol duplication, with slight variations:
>
> http[s]://https//
> myapp.herokuapp.com/users/password/edit?reset_password_token=YZoVUFRGm9DPFqGqNvuP
>
> Any further ideas?
>
> Thanks again,
>
> Scott
>
>
> On Thursday, June 20, 2013 4:29:25 PM UTC-7, Scott Olmsted wrote:
>>
>> My Rails 3.2 app hosted at Heroku uses only ssl in production:
>>
>> MyApp::Application.configure do
>> ...
>> # secure the entire site in production
>> require 'rack/ssl'
>> config.middleware.insert_before ActionDispatch::Cookies, Rack::SSL
>> ...
>>
>> I'm using Devise with this line in routes.rb:
>>
>> devise_for :users, :controllers => { :sessions => "sessions" } #
>> http://stackoverflow.com/questions/10153040/stop-devise-from-clearing-session
>>
>> To reset one's password a link to the site is sent in an email, generated
>> by this line of HAML:
>>
>> %p= link_to 'Change my password', edit_password_url(@resource,
>> :reset_password_token => @resource.reset_password_token)
>>
>> In development the url in the link looks like:
>>
>>
>> http://myapp.herokuapp.com/users/password/edit?reset_password_token=YZoVUFRGm9DPFqGqNvuP
>>
>> but in production the email sent has this in it (note the extra prefix,
>> missing a colon, at the beginning):
>>
>>
>> http://https//myapp.herokuapp.com/users/password/edit?reset_password_token=YZoVUFRGm9DPFqGqNvuP
>>
>> How do I get the production site to generate a proper url, either using
>> http or https (either will work)?
>>
>> Thanks,
>>
>> Scott
>>
>>
--
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
---
You received this message because you are subscribed to the Google Groups "SD
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.