mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Conflicts: app/controllers/admin/commercials_controller.rb app/controllers/admin/questions_controller.rb app/controllers/admin/users_controller.rb
23 lines
772 B
Ruby
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
|