Change update/save failures to use flash type :error instead of :alert
This commit is contained in:
parent
19c54bd935
commit
1c1e56ed46
10 changed files with 13 additions and 13 deletions
|
|
@ -90,7 +90,7 @@ module Admin
|
|||
notice: 'Conference was successfully updated.'
|
||||
else
|
||||
redirect_to edit_admin_conference_path(id: short_title),
|
||||
alert: 'Updating conference failed. ' \
|
||||
error: 'Updating conference failed. ' \
|
||||
"#{@conference.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ module Admin
|
|||
@event = @conference.program.events.find(params[:id])
|
||||
if !@event
|
||||
redirect_to admin_conference_program_events_path(conference_id: @conference.short_title),
|
||||
alert: 'Error! Could not find event!'
|
||||
error: 'Error! Could not find event!'
|
||||
return
|
||||
end
|
||||
@event
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ module Admin
|
|||
# GET questions/1/edit
|
||||
def edit
|
||||
if @question.global
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), alert: 'Sorry, you cannot edit global questions. Create a new one.'
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), error: 'Sorry, you cannot edit global questions. Create a new one.'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ module Admin
|
|||
if @splashpage.destroy
|
||||
redirect_to admin_conference_splashpage_path, notice: 'Splashpage was successfully destroyed.'
|
||||
else
|
||||
redirect_to admin_conference_splashpage_path, alert: 'An error prohibited this Splashpage from being destroyed: '\
|
||||
redirect_to admin_conference_splashpage_path, error: 'An error prohibited this Splashpage from being destroyed: '\
|
||||
"#{@splashpage.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ module Admin
|
|||
if @user.update_attributes(user_params)
|
||||
redirect_to admin_users_path, notice: "Updated #{@user.name} (#{@user.email})!" + message
|
||||
else
|
||||
redirect_to admin_users_path, alert: "Could not update #{@user.name} (#{@user.email}). #{@user.errors.full_messages.join('. ')}."
|
||||
redirect_to admin_users_path, error: "Could not update #{@user.name} (#{@user.email}). #{@user.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ module Admin
|
|||
if @venue.destroy
|
||||
redirect_to admin_conference_venue_path, notice: 'Venue was successfully deleted.'
|
||||
else
|
||||
redirect_to admin_conference_venue_path, alert: 'An error prohibited this Venue from being destroyed: '\
|
||||
redirect_to admin_conference_venue_path, error: 'An error prohibited this Venue from being destroyed: '\
|
||||
"#{@venue.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module Admin
|
|||
if @conference.update_attributes(conference_params)
|
||||
redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: 'Volunteering options were successfully updated.'
|
||||
else
|
||||
redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{@conference.errors.full_messages.join '. '}"
|
||||
redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), error: "Volunteering options update failed: #{@conference.errors.full_messages.join '. '}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
end
|
||||
|
||||
if @conference.registration_limit_exceeded?
|
||||
redirect_to root_path, alert: "Sorry, registration limit exceeded for #{@conference.title}"
|
||||
redirect_to root_path, error: "Sorry, registration limit exceeded for #{@conference.title}"
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
@registration = Registration.find_by(conference: @conference, user: current_user)
|
||||
if !@registration
|
||||
redirect_to new_conference_conference_registrations_path(@conference.short_title),
|
||||
alert: "Can't find a registration for #{@conference.title} for you. Please register."
|
||||
error: "Can't find a registration for #{@conference.title} for you. Please register."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class TicketPurchasesController < ApplicationController
|
|||
end
|
||||
else
|
||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||
alert: "Oops, something went wrong with your purchase! #{message}"
|
||||
error: "Oops, something went wrong with your purchase! #{message}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ class TicketPurchasesController < ApplicationController
|
|||
notice: 'Ticket successfully deleted.'
|
||||
else
|
||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||
alert: 'An error prohibited deleting your purchase! '\
|
||||
error: 'An error prohibited deleting your purchase! '\
|
||||
"#{@ticket_purchases.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ describe Admin::ConferenceController do
|
|||
short_title: nil)
|
||||
|
||||
conference.reload
|
||||
expect(flash[:alert]).
|
||||
expect(flash[:error]).
|
||||
to eq("Updating conference failed. Short title can't be blank.")
|
||||
expect(conference.title).to eq('The dog and pony show')
|
||||
expect(conference.short_title).to eq("#{conference.short_title}")
|
||||
|
|
@ -67,7 +67,7 @@ describe Admin::ConferenceController do
|
|||
attributes_for(:conference, title: 'Example Con',
|
||||
short_title: nil)
|
||||
|
||||
expect(flash[:alert]).
|
||||
expect(flash[:error]).
|
||||
to eq("Updating conference failed. Short title can't be blank.")
|
||||
expect(response).to redirect_to edit_admin_conference_path(
|
||||
conference.short_title)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue