Class: Usman::RegistrationsController

Inherits:
ResourceController show all
Defined in:
app/controllers/usman/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#update_statusObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/usman/registrations_controller.rb', line 6

def update_status
  @registration = @r_object = Registration.find(params[:id])
  case params[:status]
  when "pending"
    @registration.pending!
  when "verified"
    @registration.verify!
  when "suspended"
    @registration.suspend!
  end
  set_notification(true, I18n.t('status.success'), I18n.t('state.changed', item: default_item_name.titleize, new_state: @r_object.status))
  render_row
end