Sha256: 15f2cd42cabd3a5169fa493a6cd568a45f33aec1986ac37f5c598945e85bdf3d

Contents?: true

Size: 715 Bytes

Versions: 8

Compression:

Stored size: 715 Bytes

Contents

class ServerController < ApplicationController

  def index
    properties = Property.all_to_show
    @properties_JSON = properties.to_json
    @properties = properties.index_by(&:key)
    @properties_with_new_value = Property.all_new_values
  end

  def property
    property = Property.find params[:id]
    if property.set_value(params[:value])
      render :json => {:result => 'success'}
    else
      render :json => {:errors => property.errors.to_json}
    end
  rescue
    render :json => {:errors => t('unknown_error')}
  end

  def update
    SystemManager.change_configuration_and_restart
    render :json => {:result => 'success'}
  rescue
    render :json => {:errors => t('unknown_error')}
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rmails-0.2.1 app/controllers/server_controller.rb
rmails-0.2.0 app/controllers/server_controller.rb
rmails-0.1.6 app/controllers/server_controller.rb
rmails-0.1.5 app/controllers/server_controller.rb
rmails-0.1.4 app/controllers/server_controller.rb
rmails-0.1.3 app/controllers/server_controller.rb
rmails-0.1.2 app/controllers/server_controller.rb
rmails-0.1.1 app/controllers/server_controller.rb