2012-08-23 69 views

回答

0

最後,設計的例子很好。這些是我所做的更改

config.mailer = "Devise::Mailer"應該在devise.rb文件中取消註釋並將以下行包含在environment.rb和environment.rb文件中的環境文件夾中。

config.action_mailer.default_url_options = { :host => 'localhost:3000' } 
    config.action_mailer.delivery_method = :smtp 

    config.action_mailer.smtp_settings = { 
     :tls => true, 
     :enable_starttls_auto => true, 
     :address => "smtp.gmail.com", 
     :port => "587", 
     :domain => "gmail.com", 
     :authentication => :plain, 
     :user_name => "[email protected]", 
     :password => "yyyyyy" 
    } 

現在效果很好。

0

設計確實有一個激活功能,它被稱爲確認。

要激活它,請在您的模型中添加:confirmable模塊,並在設計配置文件中將confirm_within設置爲0。

+0

oh.ok我會試試看。 – usr

+0

我嘗試了github中提供的設計示例,當註冊完成時,我可以看到終端中的確認鏈接,以及我應該如何接收郵件。 – usr

1

紅寶石工具箱提供了一個很好的選擇,

https://www.ruby-toolbox.com/categories/rails_authentication

雖然如果我發表意見我會使用設計

+0

我試過github中提供的示例,當註冊完成時,我可以看到終端中的確認鏈接,以及我應該如何接收郵件。 – usr

+0

確保您的郵件配置設置正確。我猜你在開發模式,它不會默認發送電子郵件,但會在控制檯中吐出消息。這是一個單獨的問題,雖然... – Yule

+0

是的,我沒有任何郵件設置。你能告訴我需要做些什麼改變嗎? – usr

相關問題