Sha256: c10b417d4907ac363e3b846c8b7baaf0ceb34c7f0cc245a7a3949323e41cf32d

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

module Ixtlan
  module Controllers
    module ConfigurationsController

      # GET /configuration
      # GET /configuration.xml
      def show
        @configuration = Configuration.instance

        respond_to do |format|
          format.html # show.html.erb
          format.xml  { render :xml => @configuration }
        end
      end

      # GET /configuration/edit
      def edit
        @configuration = Configuration.instance
      end

      # PUT /configuration
      # PUT /configuration.xml
      def update
        @configuration = Configuration.instance
        @configuration.current_user = current_user

        locales =  params[:configuration].delete(:locales)
        respond_to do |format|
          if @configuration.update(params[:configuration]) or not @configuration.dirty?
            flash[:notice] = 'Configuration was successfully updated.'
            format.html { redirect_to(configuration_url) }
            format.xml  { render :xml => @configuration }
          else
            format.html { render :action => "edit" }
            format.xml  { render :xml => @configuration.errors, :status => :unprocessable_entity }
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ixtlan-0.2.4 lib/ixtlan/controllers/configurations_controller.rb
ixtlan-0.2.3 lib/ixtlan/controllers/configurations_controller.rb
ixtlan-0.2.2 lib/ixtlan/controllers/configurations_controller.rb
ixtlan-0.2.1 lib/ixtlan/controllers/configurations_controller.rb