Sha256: 009e98a046ab890d7e7db43dabdcc663a098a19808ad3d7b27710b4c020216b1

Contents?: true

Size: 1000 Bytes

Versions: 28

Compression:

Stored size: 1000 Bytes

Contents

require_dependency "smithy/base_controller"

module Smithy
  class SettingsController < BaseController
    respond_to :html, :json

    def index
      @settings = Setting.all
      respond_with @settings
    end

    def show
      @setting = Setting.find(params[:id])
      respond_with @setting
    end

    def new
      @setting = Setting.new(filtered_params)
      respond_with @setting
    end

    def create
      @setting = Setting.new(filtered_params)
      @setting.save
      flash.notice = "Your setting was created" if @setting.persisted?
      respond_with @setting
    end

    def edit
      @setting = Setting.find(params[:id])
      respond_with @setting
    end

    def update
      @setting = Setting.find(params[:id])
      flash.notice = "Your setting was saved" if @setting.update_attributes(filtered_params)
      respond_with @setting
    end

    def destroy
      @setting = Setting.find(params[:id])
      @setting.destroy
      respond_with @setting
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
smithycms-0.8.1 app/controllers/smithy/settings_controller.rb
smithycms-0.7.3 app/controllers/smithy/settings_controller.rb
smithycms-0.7.2 app/controllers/smithy/settings_controller.rb
smithycms-0.7.1 app/controllers/smithy/settings_controller.rb
smithycms-0.7.0 app/controllers/smithy/settings_controller.rb
smithycms-0.6.10 app/controllers/smithy/settings_controller.rb
smithycms-0.5.99.3 app/controllers/smithy/settings_controller.rb
smithycms-0.6.9 app/controllers/smithy/settings_controller.rb
smithycms-0.6.7 app/controllers/smithy/settings_controller.rb
smithycms-0.6.6 app/controllers/smithy/settings_controller.rb
smithycms-0.6.5 app/controllers/smithy/settings_controller.rb
smithycms-0.6.4 app/controllers/smithy/settings_controller.rb
smithycms-0.6.3 app/controllers/smithy/settings_controller.rb
smithycms-0.5.99.2 app/controllers/smithy/settings_controller.rb
smithycms-0.5.99.1 app/controllers/smithy/settings_controller.rb
smithycms-0.5.99 app/controllers/smithy/settings_controller.rb
smithycms-0.6.2 app/controllers/smithy/settings_controller.rb
smithycms-0.6.1 app/controllers/smithy/settings_controller.rb
smithycms-0.5.2 app/controllers/smithy/settings_controller.rb
smithycms-0.6.0 app/controllers/smithy/settings_controller.rb