Class: MrCommon::PreRegistrations::PreRegistrationsController
- Inherits:
-
BaseController
- Object
- BaseController
- MrCommon::PreRegistrations::PreRegistrationsController
- Defined in:
- app/controllers/mr_common/pre_registrations/pre_registrations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/mr_common/pre_registrations/pre_registrations_controller.rb', line 14 def create @pre_registration = PreRegistration.new(pre_registration_params) if @pre_registration.save redirect_to pre_registrations_path, notice: "Pre-registration saved." else flash.now[:alert] = "There was a problem saving the pre-registration." render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/mr_common/pre_registrations/pre_registrations_controller.rb', line 25 def destroy @pre_registration = PreRegistration.find(params[:id]) if @pre_registration.destroy redirect_to pre_registrations_path, notice: "Pre-registration deleted." else redirect_to pre_registrations_path, notice: "There was a problem deleting the pre-registration." end end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/mr_common/pre_registrations/pre_registrations_controller.rb', line 6 def index @pre_registration = PreRegistration.order(email: :asc) end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/mr_common/pre_registrations/pre_registrations_controller.rb', line 10 def new @pre_registration = PreRegistration.new end |