[issue #428] Fixed refs in advisory preview

This commit is contained in:
George Vinogradov 2012-07-04 03:39:57 +04:00
parent e00e88340b
commit 7515f3515d
2 changed files with 7 additions and 1 deletions

View File

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

View File

@ -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('<br />')
json.update_type advisory.update_type