Add query params to members#new
This commit is contained in:
parent
c00f7743b0
commit
ca81e4813a
@ -16,7 +16,7 @@ class MembersController < ApplicationController
|
||||
|
||||
# GET /members/new
|
||||
def new
|
||||
@member = Member.new
|
||||
@member = Member.new(get_params)
|
||||
end
|
||||
|
||||
# GET /members/1/edit
|
||||
@ -66,4 +66,8 @@ class MembersController < ApplicationController
|
||||
def member_params
|
||||
params.fetch(:member, {}).permit(:display_name, :legal_name, :pronouns, :email, :identification_number, :category, :address, :joined_on, :expires_on, :wants_mailing_list, :prefers_postal)
|
||||
end
|
||||
|
||||
def get_params
|
||||
params.permit(:display_name, :legal_name, :pronouns, :email, :identification_number, :category, :address, :joined_on, :expires_on, :wants_mailing_list, :prefers_postal)
|
||||
end
|
||||
end
|
||||
|
@ -18,7 +18,7 @@
|
||||
<tr><td><label><%= t('members.attributes.legal_name') %></label></td><td><%= form.text_field :legal_name, required: true %></label></td></tr>
|
||||
<tr><td><label><%= t('members.attributes.pronouns') %></label></td><td><%= form.text_field :pronouns %></label></td></tr>
|
||||
<tr><td><label><%= t('members.attributes.email') %></label></td><td><%= form.email_field :email, required: true %></label></td></tr>
|
||||
<tr><td><label><%= t('members.attributes.category') %></label></td><td><%= form.select :category, %w{student retired unemployed employed} %></label></td></tr>
|
||||
<tr><td><label><%= t('members.attributes.category') %></label></td><td><%= form.select :category, %w{student retired unemployed employed}, { include_blank: true }, { required: true } %></label></td></tr>
|
||||
<tr><td><label><%= t('members.attributes.identification_number') %></label></td><td><%= form.text_field :identification_number %></label></td></tr>
|
||||
<tr><td><label><%= t('members.attributes.address') %></label></td><td><%= form.text_area :address %></label></td></tr>
|
||||
<tr><td><label><%= t('members.attributes.wants_mailing_list') %></label></td><td><%= form.check_box :wants_mailing_list %></label></td></tr>
|
||||
|
Loading…
Reference in New Issue
Block a user