rubocop issues solved
This commit is contained in:
parent
5186dfcb12
commit
5cdedbf9a6
1 changed files with 4 additions and 5 deletions
|
|
@ -1,15 +1,14 @@
|
|||
module Admin
|
||||
class VenueCommercialsController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource :venue ,through: :conference, singelton: true
|
||||
load_and_authorize_resource :venue, through: :conference, singelton: true
|
||||
before_action :set_venue
|
||||
before_action :set_commercial , only: [:update , :destroy]
|
||||
before_action :set_commercial, only: [:update, :destroy]
|
||||
|
||||
def create
|
||||
@commercial = @venue.build_commercial(commercial_params)
|
||||
authorize! :create, @commercial
|
||||
|
||||
#FIXME redirect to tab#commercial
|
||||
if @commercial.save
|
||||
redirect_to edit_admin_conference_venue_path,
|
||||
notice: 'Commercial was successfully created.'
|
||||
|
|
@ -51,11 +50,11 @@ module Admin
|
|||
def commercial_params
|
||||
params.require(:commercial).permit(:url)
|
||||
end
|
||||
|
||||
|
||||
def set_venue
|
||||
@venue = @conference.venue
|
||||
end
|
||||
|
||||
|
||||
def set_commercial
|
||||
@commercial = Commercial.find params[:id]
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue