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

accounts_range_crit, crit_params, journal_entries_states_crit, journal_period_crit, journals_crit, search_conditions

Methods inherited from ApplicationController

#after_sign_in_path_for, #authorized?, human_action_name, #human_action_name

Instance Method Details

#destroyObject


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

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

#editObject


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

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
35
# File 'app/controllers/backend/registrations_controller.rb', line 34

def index
end

#updateObject


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

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