Class: Backend::RegistrationsController

Inherits:
BaseController show all
Defined in:
app/controllers/backend/registrations_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#current_theme

Instance Method Summary collapse

Methods inherited from BaseController

account_lettering_states_crit, accounts_range_crit, amount_range_crit, crit_params, journal_entries_states_crit, journal_letter_crit, journal_period_crit, journals_crit, search_conditions

Methods inherited from ApplicationController

#after_sign_in_path_for, #authorized?, human_action_name, #human_action_name, #session_controller?

Instance Method Details

#destroyObject


51
52
53
54
55
# File 'app/controllers/backend/registrations_controller.rb', line 51

def destroy
  @user = User.find(params[:id])
  @user.destroy
  redirect_to backend_registrations_path
end

#editObject


36
37
38
39
# File 'app/controllers/backend/registrations_controller.rb', line 36

def edit
  @registration = User.find(params[:id])
  @form_url = backend_registration_path(@registration)
end

#indexObject

Need to add explicitly action to detect it properly for now


34
# File 'app/controllers/backend/registrations_controller.rb', line 34

def index; end

#updateObject


41
42
43
44
45
46
47
48
49
# File 'app/controllers/backend/registrations_controller.rb', line 41

def update
  @user = User.find(params[:id])
  if @user.update(approved_params)
    RegistrationMailer.approved(@user).deliver_now
    redirect_to backend_registrations_path
  else
    render :edit
  end
end