Commit d0ac7edb by Tan Phat Nguyen

product list, send email reset password

parent 80120100
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<ul class='nav navbar-nav navbar-right'> <ul class='nav navbar-nav navbar-right'>
<li><%= link_to 'Home', root_path %></li> <li><%= link_to 'Home', root_path %></li>
<% if user_signed_in? %> <% if user_signed_in? %>
<li><%= link_to 'Products', admin_products_path %></li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
Account <b class="caret"></b> Account <b class="caret"></b>
......
<h2>Change your password</h2> <h2>Change your password</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= devise_error_messages! %> <%= render 'shared/error_messages', object: f.object %>
<%= f.hidden_field :reset_password_token %> <%= f.hidden_field :reset_password_token %>
<div class="field"> <div class="form-group">
<%= f.label :password, "New password" %><br /> <%= f.label :password, "New password" %>
<%= f.password_field :password, autofocus: true, autocomplete: "off" %> <%= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control', placeholder: 'Input new password' %>
</div> </div>
<div class="form-group">
<div class="field"> <%= f.label :password_confirmation, "Confirm new password" %>
<%= f.label :password_confirmation, "Confirm new password" %><br /> <%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: 'Input confirm password' %>
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Change my password" %>
</div> </div>
<%= f.submit "Change my password", class: 'btn btn-primary' %>
<% end %> <% end %>
<%= render "devise/shared/links" %> <%= render "devise/shared/links" %>
...@@ -14,18 +14,7 @@ Rails.application.configure do ...@@ -14,18 +14,7 @@ Rails.application.configure do
config.action_controller.perform_caching = false config.action_controller.perform_caching = false
# Don't care if the mailer can't send. # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
authentication: 'plain',
user_name: ENV['email_user'],
password: ENV['email_password'],
enable_starttls_auto: true
}
# Print deprecation notices to the Rails logger. # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log config.active_support.deprecation = :log
...@@ -46,6 +35,16 @@ Rails.application.configure do ...@@ -46,6 +35,16 @@ Rails.application.configure do
# Raises error for missing translations # Raises error for missing translations
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
authentication: 'plain',
user_name: ENV['email_user'],
password: ENV['email_password'],
enable_starttls_auto: true
}
config.solr_host = "http://localhost:8983/solr/collection1" config.solr_host = "http://localhost:8983/solr/collection1"
......
...@@ -10,7 +10,7 @@ Devise.setup do |config| ...@@ -10,7 +10,7 @@ Devise.setup do |config|
# Configure the e-mail address which will be shown in Devise::Mailer, # Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class # note that it will be overwritten if you use your own mailer class
# with default "from" parameter. # with default "from" parameter.
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' config.mailer_sender = 'bigforest20@gmail.com'
# Configure the class responsible to send e-mails. # Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer' # config.mailer = 'Devise::Mailer'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment