Skip to content
Snippets Groups Projects
Unverified Commit de71002f authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix #386

parent bd52aed7
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,13 @@ class Admin::University::Alumni::CohortsController < Admin::University::Applicat
def cohorts_params
params.require(:university_person)
.permit(cohorts_attributes: [:id, :program_id, :university_id, :year, :_destroy])
.permit(cohorts_attributes: [:id, :program_id, :year, :_destroy])
.merge(university_id: current_university.id)
.tap { |permitted_params|
permitted_params[:cohorts_attributes].transform_values! do |hash|
hash.merge(university_id: current_university.id)
end
}
end
end
......@@ -30,8 +30,13 @@ class Admin::University::Alumni::ExperiencesController < Admin::University::Appl
def experiences_params
params.require(:university_person)
.permit(experiences_attributes: [:id, :organization_id, :university_id, :description, :from_year, :to_year, :_destroy])
.permit(experiences_attributes: [:id, :organization_id, :description, :from_year, :to_year, :_destroy])
.merge(university_id: current_university.id)
.tap { |permitted_params|
permitted_params[:experiences_attributes].transform_values! do |hash|
hash.merge!(university_id: current_university.id)
end
}
end
end
......@@ -4,10 +4,6 @@
<div class="card-body">
<div class="row">
<div class="col-md-5">
<%= f.input :university_id,
as: :hidden,
input_html: { value: current_university.id },
wrapper: false %>
<%= f.association :program,
collection: collection_tree(current_university.education_programs),
label_method: ->(p) { sanitize p[:label] },
......
......@@ -9,10 +9,6 @@ hint = can?(:create, University::Organization) ? t('university.person.experienc
<div class="d-flex">
<div class="row flex-fill">
<div class="col-md-6 col-xxl-4">
<%= f.input :university_id,
as: :hidden,
input_html: { value: current_university.id },
wrapper: false %>
<%= f.association :organization,
collection: current_university.organizations.ordered,
include_blank: t('simple_form.include_blanks.defaults.organization'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment