Commit 2bcbb80f authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻 Committed by Kaspar
Browse files

adding volunteer attributes with sub concern includes

parent 1bec5463
......@@ -2,6 +2,7 @@ module VolunteerAttributes
extend ActiveSupport::Concern
included do
include ContactAttributes
def volunteer_attributes
[
:date_of_birth, :gender, :avatar, :nationality, :additional_nationality,
......@@ -9,7 +10,8 @@ module VolunteerAttributes
:strengths, :skills, :interests, :state, :duration, :man, :woman,
:family, :kid, :sport, :creative, :music, :culture, :training,
:german_course, :adults, :teenagers, :children, :region, :state,
:first_language, :title, first_language_attributes: [:id, :language]
:first_language, :title, :first_name, :last_name,
contact_attributes, language_skills_attributes, schedules_attributes
]
end
end
......
class VolunteersController < ApplicationController
include NestedAttributes
include VolunteerAttributes
include ContactAttributes
before_action :set_volunteer, only: [:show, :edit, :update, :destroy]
def index
......@@ -64,9 +63,6 @@ class VolunteersController < ApplicationController
end
def volunteer_params
params.require(:volunteer).permit(
volunteer_attributes, language_skills_attributes, schedules_attributes,
contact_attributes
)
params.require(:volunteer).permit(volunteer_attributes)
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment