diff --git a/.gitignore b/.gitignore index 1c22c62..d52db69 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,7 @@ /tmp # Ignore byebug history files -.byebug_history \ No newline at end of file +.byebug_history + +# Ignore IDE +/.idea \ No newline at end of file diff --git a/app/assets/javascripts/sign_ups.coffee b/app/assets/javascripts/sign_ups.coffee index 2763dcb..9bba7db 100644 --- a/app/assets/javascripts/sign_ups.coffee +++ b/app/assets/javascripts/sign_ups.coffee @@ -2,7 +2,8 @@ $(document).on 'ready page:load turbolinks:load', -> $('#return-button').hide() $('#confirm').hide() $('#update').hide() - + $('#children_in_birmingham_form').hide() + $('#member_ids').on 'select2:select', (e) -> $('#participation_member_id').val(e.params.data.id) $('#create').hide() @@ -14,6 +15,7 @@ $(document).on 'ready page:load turbolinks:load', -> $('#phone').text(e.params.data.phone) $('#identity_id').text(e.params.data.identity_id) $('#email').text(e.params.data.email) + $('#children_in_birmingham_school').prop("checked", e.params.data.children_in_birmingham_school) # Revert/clear create form $('#unconfirm, #return-button').on 'click', -> @@ -34,14 +36,18 @@ $(document).on 'ready page:load turbolinks:load', -> selected = e.params.data.text if selected is 'Student' $('#school').show() - $('#graduating').show() + $('#graduating').show() + $('#children_in_birmingham_form').hide() else if selected is 'Parent' or selected is 'Educator' $('#school').show() - $('#graduating').hide() + $('#graduating').hide() + $('#children_in_birmingham_form').show() else $('#school').hide() - $('#graduating').hide() - + $('#graduating').hide() + $('#children_in_birmingham_form').hide() + + # Alter create form for edit, fill with member values $('#update-signup').on 'click', -> $('#confirm').hide() diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index f3626ef..44477c4 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -126,6 +126,6 @@ def filtered_members # Never trust parameters from the scary internet, only allow the white list through. def member_params - params.require(:member).permit(:first_name, :last_name, :phone, :email, :identity, :affiliation, :address, :city, :state, :zip_code, :shirt_size, :shirt_received, :place_of_worship, :recruitment, :community_networks, :extra_groups, :other_networks, :graduating_class_id, :school_id, :identity_id, :organization_ids => [], :neighborhood_ids => [], :extracurricular_activity_ids => [], talent_ids: [], :cohort_ids => []) + params.require(:member).permit(:first_name, :last_name, :phone, :email, :identity, :affiliation, :address, :city, :state, :zip_code, :shirt_size, :shirt_received, :children_in_birmingham_school, :place_of_worship, :recruitment, :community_networks, :extra_groups, :other_networks, :graduating_class_id, :school_id, :identity_id, :organization_ids => [], :neighborhood_ids => [], :extracurricular_activity_ids => [], talent_ids: [], :cohort_ids => []) end end diff --git a/app/controllers/sign_ups_controller.rb b/app/controllers/sign_ups_controller.rb index 7e73b33..af4ffec 100644 --- a/app/controllers/sign_ups_controller.rb +++ b/app/controllers/sign_ups_controller.rb @@ -72,7 +72,7 @@ def update private def member_params - params.permit(member: [:id, :first_name, :last_name, :phone, :email, :identity_id, :school_id, :graduating_class_id])[:member] + params.permit(member: [:id, :first_name, :last_name, :phone, :email, :identity_id, :school_id, :graduating_class_id, :children_in_birmingham_school])[:member] end def participation_params diff --git a/app/views/members/_form.html.erb b/app/views/members/_form.html.erb index a236e3c..060e906 100644 --- a/app/views/members/_form.html.erb +++ b/app/views/members/_form.html.erb @@ -185,6 +185,12 @@ <%= f.text_field :community_networks, class: "form-control" %> +