rosa-build/app/controllers/advisories_controller.rb

32 lines
797 B
Ruby
Raw Normal View History

class AdvisoriesController < ApplicationController
before_filter :authenticate_user!
skip_before_filter :authenticate_user! if APP_CONFIG['anonymous_access']
2014-01-21 04:51:49 +00:00
load_resource find_by: :advisory_id
authorize_resource
def index
2014-02-12 20:10:27 +00:00
@advisories = @advisories.includes(:platforms).search(params[:q]).
uniq.paginate(page: params[:page])
respond_to do |format|
format.html
format.atom
end
end
def show
@packages_info = @advisory.fetch_packages_info
end
def search
@advisory = Advisory.by_update_type(params[:bl_type]).search_by_id(params[:query]).first
2013-08-08 13:16:51 +01:00
if @advisory.nil?
2014-01-21 04:51:49 +00:00
render nothing: true, status: 404
2013-08-08 13:16:51 +01:00
else
# respond_to do |format|
# format.json { render @advisory }
# end
render @advisory
end
end
end