Refactoring admin venue menu #304
This commit is contained in:
parent
2c98ba9711
commit
e0d39e60eb
13 changed files with 111 additions and 57 deletions
19
app/controllers/admin/venues_controller.rb
Normal file
19
app/controllers/admin/venues_controller.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module Admin
|
||||
class VenuesController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource :venue, through: :conference, singleton: true
|
||||
|
||||
def edit; end
|
||||
|
||||
def update
|
||||
if @venue.update_attributes(params[:venue])
|
||||
redirect_to(edit_admin_conference_venue_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue was successfully updated.')
|
||||
else
|
||||
flash[:error] = "Update venue failed: #{@venue.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue