osem-fcy/app/controllers/admin/dietchoices_controller.rb
Stella Rouzi e6ddb910d6 fix style
2014-08-13 22:53:13 +03:00

19 lines
685 B
Ruby

module Admin
class DietchoicesController < ApplicationController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :dietary_choice, through: :conference
def show
render :diets_list
end
def update
begin
@conference.update_attributes!(params[:conference])
redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), notice: 'Dietary choices were successfully updated.')
rescue => e
redirect_to(admin_conference_dietary_list_path(conference_id: @conference.short_title), alert: "Dietary choices update failed: #{e.message}")
end
end
end
end