Class: Backend::CobblersController

Inherits:
BaseController show all
Defined in:
app/controllers/backend/cobblers_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

#updateObject


21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/backend/cobblers_controller.rb', line 21

def update
  unless params['order']
    head :unprocessable_entity
    return
  end
  order = params['order'].to_a
  begin
    current_user.prefer!("cobbler.#{params[:id]}", { order: order }.deep_stringify_keys.to_yaml)
    head :ok
  rescue ActiveRecord::StaleObjectError
    head :locked
  end
end