Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
2bcbb80f
Commit
2bcbb80f
authored
Jun 29, 2017
by
Kaspar Vollenweider
👻
Committed by
Kaspar
Jun 30, 2017
Browse files
adding volunteer attributes with sub concern includes
parent
1bec5463
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controllers/concerns/volunteer_attributes.rb
View file @
2bcbb80f
...
...
@@ -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
...
...
app/controllers/volunteers_controller.rb
View file @
2bcbb80f
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment