done with creating relationship and generating view for venue_commercials

This commit is contained in:
Shriyansh 2016-04-05 02:24:14 +05:30
parent dc0da8c500
commit 7bbb0da17a
2 changed files with 29 additions and 22 deletions

View file

@ -3,6 +3,7 @@ module Admin
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :venue ,through: :conference, singelton: true
before_action :set_venue
before_action :set_commercial , only: [:update , :destroy]
def create
@commercial = @venue.build_commercial(commercial_params)
@ -54,5 +55,9 @@ module Admin
def set_venue
@venue = @conference.venue
end
def set_commercial
@commercial = Commercial.find params[:id]
end
end
end