From 57f7de266b4c956e1819bec6d63f93b4426dd57c Mon Sep 17 00:00:00 2001 From: Marv Cool Date: Tue, 15 Jan 2013 16:26:03 +0100 Subject: [PATCH] disables json formatted output this refs #21 --- app/controllers/experimentruns_controller.rb | 6 +++--- app/controllers/experiments_controller.rb | 16 ++++++++-------- app/controllers/testbed_controller.rb | 19 ------------------- app/controllers/users_controller.rb | 16 ++++++++-------- 4 files changed, 19 insertions(+), 38 deletions(-) diff --git a/app/controllers/experimentruns_controller.rb b/app/controllers/experimentruns_controller.rb index 303393a..7e8de80 100644 --- a/app/controllers/experimentruns_controller.rb +++ b/app/controllers/experimentruns_controller.rb @@ -35,10 +35,10 @@ def create if @run.save @run.delay.run! format.html { redirect_to experiment_path(params[:experiment_run][:experiment_id]), notice: 'Run was successfully created.' } - format.json { render json: @run, status: :created, location: experiment_path(params[:experiment_run][:experiment_id]) } + #format.json { render json: @run, status: :created, location: experiment_path(params[:experiment_run][:experiment_id]) } else format.html { redirect_to experiment_path(params[:experiment_run][:experiment_id]), notice: 'Error while creating Run: ' + @run.errors } - format.json { render json: @run.errors, status: :unprocessable_entity } + #format.json { render json: @run.errors, status: :unprocessable_entity } end end end @@ -66,7 +66,7 @@ def destroy respond_to do |format| format.html { redirect_to root_path } - format.json { head :no_content } + #format.json { head :no_content } end end diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index f4944b4..f684778 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -18,7 +18,7 @@ def show respond_to do |format| format.html # show.html.erb - format.json { render json: @experiment } + #format.json { render json: @experiment } end end @@ -33,7 +33,7 @@ def index end respond_to do |format| format.html # index.html.erb - format.json { render json: @experiments } + #format.json { render json: @experiments } end end @@ -44,7 +44,7 @@ def new respond_to do |format| format.html # new.html.erb - format.json { render json: @experiment } + #format.json { render json: @experiment } end end @@ -64,10 +64,10 @@ def create respond_to do |format| if @experiment.save format.html { redirect_to @experiment, notice: 'Experiments was successfully created.' } - format.json { render json: @experiment, status: :created, location: @user } + #format.json { render json: @experiment, status: :created, location: @user } else format.html { render action: "new" } - format.json { render json: @experiment.errors, status: :unprocessable_entity } + #format.json { render json: @experiment.errors, status: :unprocessable_entity } end end end @@ -81,10 +81,10 @@ def update respond_to do |format| if @experiment.update_attributes(params[:experiment]) format.html { redirect_to @experiment, notice: 'Experiment was successfully updated.' } - format.json { head :no_content } + #format.json { head :no_content } else format.html { render action: "edit" } - format.json { render json: @experiment.errors, status: :unprocessable_entity } + #format.json { render json: @experiment.errors, status: :unprocessable_entity } end end end @@ -98,7 +98,7 @@ def destroy respond_to do |format| format.html { redirect_to experiments_url } - format.json { head :no_content } + #format.json { head :no_content } end end diff --git a/app/controllers/testbed_controller.rb b/app/controllers/testbed_controller.rb index 483bc2d..29c6d23 100644 --- a/app/controllers/testbed_controller.rb +++ b/app/controllers/testbed_controller.rb @@ -1,23 +1,4 @@ class TestbedController < ApplicationController skip_before_filter :require_login, :only => [:show, :index] - - # GET /testbeds/:shortname/authenticate.json - def authenticate - secret_auth_keys = current_user.authenticate_with_testbed(Testbed.find_by_shortname(params[:shortname])) - respond_to do |format| - if secret_auth_keys - format.json { - cookies["wisebed-secret-authentication-key-"+params[:shortname]] = { - :value => Base64.encode64(secret_auth_keys.to_json), - :domain => "http://wisebed.itm.uni-luebeck.de" - } - render json: secret_auth_keys, :status => :ok } - else - format.json { render json: "no", :status => :forbidden } - end - end - - end - end \ No newline at end of file diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 22f0b3f..453c0c9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -7,7 +7,7 @@ def index respond_to do |format| format.html # index.html.erb - format.json { render json: @users } + #format.json { render json: @users } end end @@ -18,7 +18,7 @@ def show respond_to do |format| format.html # show.html.erb - format.json { render json: @user } + #format.json { render json: @user } end end @@ -29,7 +29,7 @@ def new respond_to do |format| format.html # new.html.erb - format.json { render json: @user } + #format.json { render json: @user } end end @@ -47,10 +47,10 @@ def create respond_to do |format| if @user.save format.html { redirect_to @user, notice: 'User was successfully created.' } - format.json { render json: @user, status: :created, location: @user } + #format.json { render json: @user, status: :created, location: @user } else format.html { render action: "new" } - format.json { render json: @user.errors, status: :unprocessable_entity } + #format.json { render json: @user.errors, status: :unprocessable_entity } end end end @@ -91,10 +91,10 @@ def update respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to @user, notice: 'User was successfully updated.' } - format.json { head :no_content } + #format.json { head :no_content } else format.html { render action: "edit" } - format.json { render json: @user.errors, status: :unprocessable_entity } + #format.json { render json: @user.errors, status: :unprocessable_entity } end end end @@ -115,7 +115,7 @@ def destroy respond_to do |format| format.html { redirect_to users_url } - format.json { head :no_content } + #format.json { head :no_content } end end end