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