ruby on rails - How can I invite users (using devise_invitable) and populate additional fields during the invite process? -
for example, when go users/invitations/new , field :email . i'd invite user and, in addition providing email, provide: first_name last_name role company ( user belongs_to company ) i created users::invitationscontroller < devise::invitationscontroller : class users::invitationscontroller < devise::invitationscontroller private def resource_params params.permit(user: [:email, :invitation_token, :role, :company_id])[:user] end end and added fields users/invitations/new . invitation sends fine, when accept , input password, validation fails saying no role selected (b/c of validation). how can set these fields before sending invite , have them persist , save when invite accepted? thanks! rails 5 here solution using accepts_nested_attributes_for . if custom attributes directly on user model should able replace profile_attributes: [:first_name, :last_name] :first_name, :last_name, :role, :company . here controller. class invitations