mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 06:01:12 +00:00
Add flash type error.Rewrite controllers to use common flash style with redirect_to
This commit is contained in:
parent
dcdceb7c6d
commit
434eb90b76
16 changed files with 81 additions and 85 deletions
|
|
@ -60,11 +60,12 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
sign_in(@registration.user)
|
||||
end
|
||||
|
||||
flash[:notice] = 'You are now registered and will be receiving E-Mail notifications.'
|
||||
if @conference.tickets.any? && !current_user.supports?(@conference)
|
||||
redirect_to conference_tickets_path(@conference.short_title)
|
||||
redirect_to conference_tickets_path(@conference.short_title),
|
||||
notice: 'You are now registered and will be receiving E-Mail notifications.'
|
||||
else
|
||||
redirect_to conference_conference_registrations_path(@conference.short_title)
|
||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||
notice: 'You are now registered and will be receiving E-Mail notifications.'
|
||||
end
|
||||
else
|
||||
flash[:error] = "Could not create your registration for #{@conference.title}: "\
|
||||
|
|
@ -100,8 +101,8 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
def set_registration
|
||||
@registration = Registration.find_by(conference: @conference, user: current_user)
|
||||
if !@registration
|
||||
flash[:alert] = "Can't find a registration for #{@conference.title} for you. Please register."
|
||||
redirect_to new_conference_conference_registrations_path(@conference.short_title)
|
||||
redirect_to new_conference_conference_registrations_path(@conference.short_title),
|
||||
alert: "Can't find a registration for #{@conference.title} for you. Please register."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue