diff --git a/app/controllers/admin/education/schools_controller.rb b/app/controllers/admin/education/schools_controller.rb index 2fa2f4fa1f3da19b9c6c3122afaac757a89fbd63..18ed93ed490c071cdbd12a8ecf6e7d484f6aaeb8 100644 --- a/app/controllers/admin/education/schools_controller.rb +++ b/app/controllers/admin/education/schools_controller.rb @@ -54,6 +54,6 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl def school_params params.require(:education_school) - .permit(:university_id, :name, :address, :zipcode, :city, :country, :phone) + .permit(:university_id, :name, :address, :zipcode, :city, :country, :phone, program_ids: []) end end diff --git a/app/views/admin/education/schools/_form.html.erb b/app/views/admin/education/schools/_form.html.erb index 9ce2da5d4c68effb2d83ce8ecb340053670de17e..e4866ce86e01459802c78faaf297bad154c96b5a 100644 --- a/app/views/admin/education/schools/_form.html.erb +++ b/app/views/admin/education/schools/_form.html.erb @@ -4,7 +4,7 @@ <%= f.input :name %> <%= f.input :phone %> </div> - <div class="col-md-8"> + <div class="col-md-4"> <%= f.input :address %> <div class="row"> <div class="col-md-4"> @@ -16,6 +16,11 @@ </div> <%= f.input :country %> </div> + <div class="col-md-4"> + <%= f.association :programs, + as: :check_boxes, + collection: current_university.education_programs.ordered %> + </div> </div> <% content_for :action_bar_right do %> <%= submit f %>