User can now add a phone number

This commit is contained in:
2017-11-10 10:25:25 +01:00
parent 421f9907b9
commit e9a73ea5cb
8 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ class SupportersController < ApplicationController
private
def supporter_form_params
params.require(:supporter).permit(:first_name, :last_name, :street, :zip, :email, :support, :li_membership, :age_category, :city, :comments)
params.require(:supporter).permit(:first_name, :last_name, :street, :zip, :email, :support, :li_membership, :age_category, :city, :comments, :tel)
end
# We use sendy for newsletters atm
+1
View File
@@ -45,6 +45,7 @@ class Supporter
field :comments, type: String
field :language, type: String
field :duplicate, type: Boolean, default: false
field :tel, type: String
validates :first_name, presence: true
validates :last_name, presence: true
+1
View File
@@ -9,6 +9,7 @@
= f.input :city, placeholder: t('.placeholders.city')
= f.input :zip, placeholder: t('.placeholders.zip')
= f.input :email, placeholder: t('.placeholders.email')
= f.input :tel, placeholder: '+41 (0) xxxx'
= f.input :support, as: :radio_buttons, collection: t('support_type').map{ |x| [x.first, raw(x.last)]}, label_method: :last, value_method: :first
= f.input :li_membership, as: :boolean
= f.input :age_category, as: :radio_buttons, collection: t('age_category'), label_method: :last, value_method: :first
+2
View File
@@ -23,6 +23,8 @@
dd == t("age_category.#{current_supporter.age_category}")
dt = Supporter.human_attribute_name(:language)
dd = t("languages.#{current_supporter.language}")
dt = Supporter.human_attribute_name(:tel)
dd = current_supporter.tel
p
= link_to t('.edit'), edit_supporter_registration_path(), class: 'pull-right'