osem-fcy/app/controllers/admin/lodgings_controller.rb
Stella Rouzi 17ebad413e base controller
Conflicts:
	app/controllers/admin/commercials_controller.rb
	app/controllers/admin/questions_controller.rb
	app/controllers/admin/users_controller.rb
2014-08-14 11:36:07 +03:00

23 lines
772 B
Ruby

module Admin
class LodgingsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :venue, through: :conference, singleton: true
authorize_resource :lodging, through: :venue
def index
authorize! :update, Lodging.new(venue_id: @venue.id)
end
def show; end
def update
if @venue.update_attributes(params[:venue])
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
notice: 'Lodgings were successfully updated.')
else
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
notice: 'Updating lodgings failed!')
end
end
end
end