Sha256: fc42558ee280369aee842e857b0c33456471d3c2ec0c26f4ec7638b7710f95a8
Contents?: true
Size: 1.14 KB
Versions: 21
Compression:
Stored size: 1.14 KB
Contents
class RhosyncConsole::Server get '/device/create' do session[:errors] = nil handle_api_error("Can't create new device") do RhosyncApi::create_client(session[:server],session[:token],params[:user_id]) end redirect url_path("/user?user_id=#{CGI.escape(params[:user_id])}"), 303 end get '/device' do @attributes = [] handle_api_error("Can't load list of device attributes") do @attributes = RhosyncApi::get_client_params(session[:server],session[:token],params[:device_id]) end @sources = [] handle_api_error("Can't load list of sources") do @sources = RhosyncApi::list_sources(session[:server],session[:token],:all) end erb :client, :layout => false end get '/device/delete' do handle_api_error("Can't delete device #{params[:device_id]}") do RhosyncApi::delete_client(session[:server],session[:token], params[:user_id],params[:device_id]) end redirect url_path(session[:errors] ? "/device?user_id=#{CGI.escape(params[:user_id])}&device_id=#{CGI.escape(params[:device_id])}" : "/user?user_id=#{CGI.escape(params[:user_id])}"), 303 end end
Version data entries
21 entries across 21 versions & 1 rubygems
Version | Path |
---|---|
rhosync-2.1.2 | lib/rhosync/console/app/routes/client.rb |