Class: Qor::Layout::SettingsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/qor/layout/settings_controller.rb

Instance Method Summary collapse

Instance Method Details

#toggleObject



6
7
8
9
# File 'app/controllers/qor/layout/settings_controller.rb', line 6

def toggle
  inline_editing_qor_layout? ? disable_editing_qor_layout : enable_editing_qor_layout
  redirect_to params[:back] || :back
end

#updateObject



11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/qor/layout/settings_controller.rb', line 11

def update
  @resource = Qor::Layout::Setting.find_by_id(params[:id])
  @resource.update_attributes(params[:setting])

  if request.xhr?
    render :text => 'ok'
  else
    redirect_to params[:back] || :back
  end
end