devise userで会員登録そしてログイン機能を作成している最中でviewページの変種ができません。
会員登録時にEメールやパスワードのほかに住所や電話番号などの記入欄も作成したのですが、それが反映されません。
もともと編集することは不可能なのでしょうか?
views\users/registrations/new.haml.erb
<h2><%= t('.sign_up') %></h2> <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> <%= render "devise/shared/error_messages", resource: resource %> <div class="field"> <%= f.label :name %><br /> <%= f.name_field :name, autofocus: true, autocomplete: "name" %> </div> <div class="field"> <%= f.label :furiganaName %><br /> <%= f.furiganaName_field :furiganaName, autofocus: true, autocomplete: "furiganaName" %> </div> <div class="field"> <%= f.label :email %><br /> <%= f.email_field :email, autofocus: true, autocomplete: "email" %> </div> <div class="field"> <%= f.label :post_code %><br /> <%= f.post_code_field :post_code, autofocus: true, autocomplete: "post_code" %> </div> <div class="field"> <%= f.label :address %><br /> <%= f.address_field :address, autofocus: true, autocomplete: "address" %> </div> <div class="field"> <%= f.label :telephone_number %><br /> <%= f.telephone_number_field :telephone_number, autofocus: true, autocomplete: "telephone_number" %> </div> <div class="field"> <%= f.label :password %> <% if @minimum_password_length %> <em><%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %></em> <% end %><br /> <%= f.password_field :password, autocomplete: "new-password" %> </div> <div class="field"> <%= f.label :password_confirmation %><br /> <%= f.password_field :password_confirmation, autocomplete: "new-password" %> </div> <div class="actions"> <%= f.submit t('.sign_up') %> </div> <% end %> <%= render "users/shared/links" %>
deviseの使用が今回初めてなのでこれがテンプレートになっていて変更できないということでしょうか?
教えて頂けたら幸いです。
!追加
調べるとapplication_controllerに追加を許可する必要があると知り、記入したのですが、
それでも表示されませんでした
application_controller
class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_action :configure_permitted_parameters, if: :devise_controller? protected def configure_permitted_parameters added_attrs = [ :name, :email, :password, :furiganaName, :telephone_number, :address, :post_code] devise_parameter_sanitizer.permit :sign_up, keys: added_attrs end end

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2022/09/26 11:55
2022/09/26 13:30
退会済みユーザー
2022/09/26 14:06