Sha256: feb9a6e06f4b95b33e30bb6df8c43eab54e79f8b958cc628681df557364c7b6a

Contents?: true

Size: 1.53 KB

Versions: 15

Compression:

Stored size: 1.53 KB

Contents

module Ixtlan
  module Core
    module Controllers
      module ConfigurationController
        
        # GET /configuration
        # GET /configuration.xml
        # GET /configuration.json
        def show
          @config = Rails.application.config.configuration_model.instance
          
          respond_to do |format|
            format.html # index.html.erb 
            format.xml  { render :xml => @config }
            format.json  { render :json => @config }
          end
        end

        # GET configuration/edit
        def edit
          @config = Rails.application.config.configuration_model.instance
        end
        
        # PUT configuration
        # PUT configuration.xml
        def update
          @config = Rails.application.config.configuration_model.instance
          
          if @config.respond_to? :current_user && respond_to? :current_user
            @config.current_user = current_user
          end

          respond_to do |format|
            if @config.update_attributes
              format.html { redirect_to(@config, :notice => 'configuration was successfully updated.') }
              format.xml  { render :xml => @config }
              format.json  { render :json => @config }
            else
              format.html { render :action => "edit" }
              format.xml  { render :xml => @config.errors, :status => :unprocessable_entity }
              format.json  { render :json => @config.errors, :status => :unprocessable_entity }
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ixtlan-core-0.8.0 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.7.5 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.7.4 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.7.3 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.7.2 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.7.1 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.7.0 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.6.1 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.6.0 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.5.0 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.4.1 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.4.0 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.2.0 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.1.1 lib/ixtlan/core/controllers/configuration_controller.rb
ixtlan-core-0.1.0 lib/ixtlan/core/controllers/configuration_controller.rb