續昨天的part1,
繼續紀錄專案過程學會的一些小玩具
config/environments/development.rb
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
app/views/layouts/application.html.erb
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
root :to => "controller#method"
<% if current_user %>
<%= link_to('登出', destroy_user_session_path, :method => :delete) %> |
<%= link_to('修改密碼', edit_registration_path(:user)) %>
<% else %>
<%= link_to('註冊', new_registration_path(:user)) %> |
<%= link_to('登入', new_session_path(:user)) %>
<% end %>
class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?
privated
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:nickname])
devise_parameter_sanitizer.permit(:account_update, keys: [:nickname])
end
end
devise安裝二部曲分享完畢,
我是程式新手麻瓜新手,
再變苦瓜之前趕緊上來紀錄!
謝謝