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

fix

parent a30f64ab
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl
def create
@school.university = current_university
if @school.save
if @school.save_and_sync
redirect_to [:admin, @school], notice: t('admin.successfully_created_html', model: @school.to_s)
else
breadcrumb
......@@ -31,7 +31,7 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl
end
def update
if @school.update(school_params)
if @school.update_and_sync(school_params)
redirect_to [:admin, @school], notice: t('admin.successfully_updated_html', model: @school.to_s)
else
breadcrumb
......@@ -41,7 +41,7 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl
end
def destroy
@school.destroy
@school.destroy_and_sync
redirect_to admin_university_schools_url, notice: t('admin.successfully_destroyed_html', model: @school.to_s)
end
......
......@@ -29,9 +29,9 @@
<div class="card-body">
<%= f.association :programs,
as: :check_boxes,
collection: collection_tree(current_university.education_programs,
collection: collection_tree(current_university.education_programs),
label_method: ->(p) { sanitize p[:label] },
value_method: ->(p) { p[:id] } %>
value_method: ->(p) { p[:id] } %>
</div>
</div>
</div>
......
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