Sha256: cacb390b32c132899c58e37301c84802441a2cd200b6a47e05c8dd96e6e5b415
Contents?: true
Size: 1.09 KB
Versions: 77
Compression:
Stored size: 1.09 KB
Contents
class Admin::SettingsController < Admin::BaseController respond_to :html, :js def index @skip_filter = true @settings = Setting.order("key") if Fullstack::Cms.localized? @settings = @settings.where(:locale => params[:locale]) @locale = params[:locale] end @groups = {} @settings.each {|s| @groups[s.group] ||= [] @groups[s.group] << s } @groups = @groups.to_a @groups.sort! do |g1, g2| if g1.first.to_s == "global" -1 elsif g2.first.to_s == "global" 1 else g1.first.to_s <=> g2.first.to_s end end end def new @setting = Setting.new end def edit end def create @setting = Setting.new(params[:setting]) if @setting.respond_to?(:author) @setting.author ||= current_user end @setting.save respond_with(@setting) end def update @setting.attributes = params[:setting] @setting.save respond_with(@setting) end def destroy @setting.destroy respond_with(@setting) end end
Version data entries
77 entries across 77 versions & 1 rubygems