-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ allows to config profile on sign up (#74)
- Loading branch information
1 parent
5ec329e
commit b17b16a
Showing
7 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module DeviseOverrides | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
before_action :configure_permitted_parameters, if: :devise_controller? | ||
end | ||
|
||
def configure_permitted_parameters | ||
devise_parameter_sanitizer.permit( | ||
:sign_up, | ||
keys: [:email, :password, { profile_attributes: %i[display_name username] }] | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,22 @@ | |
</div> | ||
|
||
<div class="mb-6"> | ||
<%= f.text_field_component(:email, type: "email", id: "email") do |input| %> | ||
<%= f.fields_for :profile, resource.build_profile do |profile_fields| %> | ||
<div class="mb-6"> | ||
<%= profile_fields.text_field_component(:display_name, type: "display_name", id: "display_name", placeholder: "Jane Doe") do |input| %> | ||
<% input.label { t(".display_name") } %> | ||
<% end %> | ||
<div> | ||
<div class="mb-6"> | ||
<%= profile_fields.text_field_component(:username, type: "username", id: "username", placeholder: "janedoe") do |input| %> | ||
<% input.label { t(".username") } %> | ||
<% end %> | ||
<div> | ||
<% end %> | ||
<div> | ||
|
||
<div class="mb-6"> | ||
<%= f.text_field_component(:email, type: "email", id: "email", placeholder: "[email protected]") do |input| %> | ||
<% input.label { t(".email") } %> | ||
<% end %> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters