Class: MembershipChangesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/membership_changes_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/membership_changes_controller.rb', line 4

def create
  change = MembershipChange.new(membership_change_params)
  if change.save
    # Success!
    flash[:success] = 'Memberships have been successfully changed.'
  else
    # Error!
    flash[:error] = error_message
  end
rescue Exception => e
  Rails.logger.info(e.message)
  Rails.logger.info(e.backtrace.join("\n"))

  flash[:error] = error_message
ensure
  redirect_to person_memberships_path(@person)
end