18 lines
353 B
Ruby
18 lines
353 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CvesController < ApplicationController
|
|
def index
|
|
@cves = Cve.all
|
|
render json: @cves.to_json
|
|
end
|
|
|
|
def show
|
|
@cve = Cve.find_by_id(params[:cve_id])
|
|
render json: @cve.to_json
|
|
end
|
|
|
|
def show_year
|
|
@cves_for_year = Cve.from_year(params[:year])
|
|
render json: @cves_for_year.to_json
|
|
end
|
|
end
|