Sha256: e33e84bb1d331418a10b47b0509f945cdbf6f63f0e21cbe9dd2246fafd5ed19b
Contents?: true
Size: 1.04 KB
Versions: 2
Compression:
Stored size: 1.04 KB
Contents
class Admin::SettingsController < Admin::BaseController cache_sweeper :blog_sweeper def index this_blog.base_url = blog_base_url if this_blog.base_url.blank? load_settings end def write load_settings end def feedback load_settings end def display load_settings end def update load_settings if @setting.update_attributes(settings_params) load_lang flash[:success] = I18n.t('admin.settings.update.success') redirect_to action: action_param else flash[:error] = I18n.t('admin.settings.update.error', messages: this_blog.errors.full_messages.join(', ')) render action_param end end private VALID_ACTIONS = %w(index write feedback display).freeze def settings_params @settings_params ||= params.require(:setting).permit! end def action_param @action_param ||= begin value = params[:from] VALID_ACTIONS.include?(value) ? value : 'index' end end def load_settings @setting = this_blog end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
publify_core-9.0.0.pre2 | app/controllers/admin/settings_controller.rb |
publify_core-9.0.0.pre1 | app/controllers/admin/settings_controller.rb |