Sha256: 9ccbaf3f3426318577d3073ca8b3444d8c0d77ccd952d3201016299cdac8d7b0

Contents?: true

Size: 900 Bytes

Versions: 28

Compression:

Stored size: 900 Bytes

Contents

class SettingsController < ApplicationController

  before_filter :authenticate
  before_filter :authenticate_with_admin

  def index
    redirect_to setting_path(Setting.first)
  end

  def show
    @setting = Setting.first
    switch_to_admin_layout
  end

  def edit
    @setting = Setting.first
    switch_to_admin_layout
  end

  def update
    @setting = Setting.first
    if @setting.update_attributes(setting_params)
      redirect_to @setting, notice: t('settings.update.notice')
    else
      render action: "edit", warning: t('settings.update.warning')
    end
  end

  private

  # Never trust parameters from the scary internet, only allow the white list through.
  def setting_params
    params.require(:setting).permit( :company_name, :contact_email, :site_name, :site_tagline, :blog_name, :blog_tagline, :disable_blog, :enable_comments_in_pages, :enable_comments_in_blog )
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
tkh_admin_panel-0.10 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.27 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.26 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.25 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.24 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.23 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.22 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.21 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.20 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.19 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.18 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.17 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.16 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.15 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.14 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.13 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.12 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.11 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.10 app/controllers/settings_controller.rb
tkh_admin_panel-0.9.9 app/controllers/settings_controller.rb