Class: Qbrick::Cms::SettingsCollectionsController

Inherits:
BackendController
  • Object
show all
Defined in:
app/controllers/qbrick/cms/settings_collections_controller.rb

Instance Method Summary collapse

Methods inherited from BackendController

#default_url_options, #reset_remembered_locale, #set_content_locale

Instance Method Details

#indexObject



4
5
6
7
8
9
10
# File 'app/controllers/qbrick/cms/settings_collections_controller.rb', line 4

def index
  @settings_collections = [
    Qbrick::SettingsCollection.find_by(collection_type: 'site'),
    Qbrick::SettingsCollection.find_by(collection_type: 'page'),
    Qbrick::SettingsCollection.find_by(collection_type: 'global')
  ]
end

#updateObject



12
13
14
15
16
17
# File 'app/controllers/qbrick/cms/settings_collections_controller.rb', line 12

def update
  @settings_collection = Qbrick::SettingsCollection.find(params[:id])
  @settings_collection.update_attributes(settings_collection_params)

  respond_with @settings_collection, location: cms_settings_collections_path
end