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

Commit

Permalink
Remove the json action
Browse files Browse the repository at this point in the history
Raw report json can now be obtained from the show action using
Accept: application/json header.
  • Loading branch information
mmilata committed Sep 19, 2014
1 parent 166412a commit 698bd5b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
13 changes: 5 additions & 8 deletions app/controllers/abrt_reports_controller.rb
Expand Up @@ -3,12 +3,10 @@ class AbrtReportsController < ApplicationController
include AbrtReportsHelper

before_filter :setup_search_options, :only => :index
before_filter :find_by_id, :only => [:show, :destroy, :json, :forward]
before_filter :find_by_id, :only => [:show, :destroy, :forward]

def action_permission
case params[:action]
when 'json'
:view
when 'forward'
:forward
else
Expand All @@ -23,6 +21,10 @@ def index

# GET /abrt_reports/42
def show
respond_to do |format|
format.html
format.json { render :json => @abrt_report.json }
end
end

# DELETE /abrt_reports/42
Expand All @@ -35,11 +37,6 @@ def destroy
redirect_to abrt_reports_url
end

# GET /abrt_reports/42/json
def json
render :json => JSON.parse(@abrt_report.json)
end

# POST /abrt_reports/42/forward
def forward
redirect_to abrt_report_url(@abrt_report)
Expand Down
1 change: 0 additions & 1 deletion app/views/abrt_reports/show.html.erb
Expand Up @@ -2,7 +2,6 @@
<%= title_actions link_to(_("Host details"), @abrt_report.host),
link_to(_("Other reports for this host"), host_abrt_reports_path(@abrt_report.host)),
link_to(_("JSON"), json_abrt_report_path(@abrt_report)),
link_to(_("Forward report"),
forward_abrt_report_path(@abrt_report),
:class => "btn btn-success",
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Expand Up @@ -2,7 +2,6 @@

resources :abrt_reports, :only => [:index, :show, :destroy] do
member do
get 'json'
post 'forward'
end
collection do
Expand Down

0 comments on commit 698bd5b

Please sign in to comment.