Add booths to non admin

This commit is contained in:
nasia 2017-07-20 14:20:46 +03:00 committed by Stella Rouzi
parent 033dbe4c40
commit 32c5af2a17
22 changed files with 426 additions and 86 deletions

View file

@ -7,9 +7,13 @@ module Admin
def show; end
def new; end
def new
@url = admin_conference_booths_path(@conference.short_title)
end
def create
@url = admin_conference_booths_path(@conference.short_title)
@booth = @conference.booths.new(booth_params)
@booth.submitter = current_user
@ -23,9 +27,13 @@ module Admin
end
end
def edit; end
def edit
@url = admin_conference_booth_path(@conference.short_title, @booth.id)
end
def update
@url = admin_conference_booth_path(@conference.short_title, @booth.id)
@booth.update_attributes(booth_params)
if @booth.save
@ -38,16 +46,6 @@ module Admin
end
end
def destroy
if @booth.destroy
redirect_to admin_conference_booths_path,
notice: 'Booth successfully destroyed.'
else
redirect_to admin_conference_booths_path,
error: "Booth couldn't be deleted. #{@booth.errors.full_messages.join('. ')}."
end
end
def accept
update_state(:accept, 'Booth accepted!')
end