experimenting with adding a route to show cves for specific year

This commit is contained in:
Brendan McDevitt 2022-04-05 12:33:51 -05:00
parent 8cbe59f55b
commit 7f8dbc606e
3 changed files with 4 additions and 2 deletions

View file

@ -9,6 +9,6 @@ class CvesController < ApplicationController
end
def show_year
@cves_for_year = Cve.for_year(params[:year])
@cves_for_year = Cve.from_year(params[:year])
end
end

View file

@ -0,0 +1,2 @@
<h1> params[:year] </h1>
<h1> <%= @cves_for_year %> </h1>

View file

@ -2,7 +2,7 @@ Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
get "/cves", to: "cves#index"
get "/cves/:cve_id", to: "cves#show"
get "/cves/:year", to: "cves#show_year"
get "/cves/years/:year", to: "cves#show_year"
get "/cpes", to: "cpes#index"
get "/cpes/:id", to: "cpes#show"