Style
This commit is contained in:
parent
2e692f7ea5
commit
01086813af
37 changed files with 221 additions and 190 deletions
|
|
@ -14,8 +14,8 @@ module Admin
|
|||
def create
|
||||
@target = @conference.targets.new(target_params)
|
||||
if @target.save(target_params)
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully created.')
|
||||
flash[:notice] = 'Target successfully created.'
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title)
|
||||
else
|
||||
flash[:error] = "Creating target failed: #{@target.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -26,8 +26,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @target.update_attributes(target_params)
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully updated.')
|
||||
flash[:notice] = 'Target successfully updated.'
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title)
|
||||
else
|
||||
flash[:error] = "Target update failed: #{@target.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -36,12 +36,12 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @target.destroy
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully destroyed.')
|
||||
flash[:notice] = 'Target successfully destroyed.'
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title)
|
||||
else
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
error: 'Target was successfully destroyed.' \
|
||||
"#{@target.errors.full_messages.join('. ')}.")
|
||||
flash[:error] = 'Target was successfully destroyed.' \
|
||||
"#{@target.errors.full_messages.join('. ')}."
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue