Sha256: a1a87a4ee7cc5e8faad65b46939debda76374ec99382c8fa38d22d8f32f897c0

Contents?: true

Size: 707 Bytes

Versions: 4

Compression:

Stored size: 707 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}
    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

4 entries across 4 versions & 1 rubygems

Version Path
rmails-0.2.5 app/controllers/server_controller.rb
rmails-0.2.4 app/controllers/server_controller.rb
rmails-0.2.3 app/controllers/server_controller.rb
rmails-0.2.2 app/controllers/server_controller.rb