diff --git a/app/controllers/advisories_controller.rb b/app/controllers/advisories_controller.rb index 3440fb3d0..c09cda470 100644 --- a/app/controllers/advisories_controller.rb +++ b/app/controllers/advisories_controller.rb @@ -30,7 +30,7 @@ class AdvisoriesController < ApplicationController @advisory = Advisory.by_update_type(params[:bl_type]).search_by_id(params[:query]).limit(1).first raise ActionController::RoutingError.new('Not Found') if @advisory.nil? respond_to do |format| - format.json { render :json => @advisory } + format.json { render @advisory } end end diff --git a/app/views/advisories/_advisory.json.jbuilder b/app/views/advisories/_advisory.json.jbuilder new file mode 100644 index 000000000..5bf528434 --- /dev/null +++ b/app/views/advisories/_advisory.json.jbuilder @@ -0,0 +1,6 @@ +json.id advisory.id +json.advisory_id advisory.advisory_id +json.description advisory.description +json.references advisory.references.split("\n").map { |ref| construct_ref_link(ref) }.join('
') +json.update_type advisory.update_type +