Sha256: 525470f86870128210ae31548d27d43ec311e0b8161db6a6b7dcb169a468ba50

Contents?: true

Size: 444 Bytes

Versions: 3

Compression:

Stored size: 444 Bytes

Contents

module ConfigurableEngine
  module ConfigurablesController
    def show
      @keys = Configurable.keys
    end

    def update
      Configurable.keys.each do |key|
        configurable = Configurable.find_by_name(key) ||
            Configurable.create {|c| c.name = key}
        configurable.update_attribute(:value,params[key])
      end
      redirect_to admin_configurable_path, :notice => "Changes successfully updated"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
configurable_engine-0.3.3 lib/configurable_engine/configurables_controller.rb
configurable_engine-0.3.2 lib/configurable_engine/configurables_controller.rb
configurable_engine-0.3.1 lib/configurable_engine/configurables_controller.rb