Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
disables json formatted output
Browse files Browse the repository at this point in the history
this refs #21
  • Loading branch information
Marv Cool committed Jan 15, 2013
1 parent 0c9ea28 commit 57f7de2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 38 deletions.
6 changes: 3 additions & 3 deletions app/controllers/experimentruns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions app/controllers/experiments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
19 changes: 0 additions & 19 deletions app/controllers/testbed_controller.rb
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 57f7de2

Please sign in to comment.