experimenting with adding a route to show cves for specific year
This commit is contained in:
parent
8cbe59f55b
commit
7f8dbc606e
3 changed files with 4 additions and 2 deletions
|
@ -9,6 +9,6 @@ class CvesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_year
|
def show_year
|
||||||
@cves_for_year = Cve.for_year(params[:year])
|
@cves_for_year = Cve.from_year(params[:year])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
2
app/views/cves/show_years.html.erb
Normal file
2
app/views/cves/show_years.html.erb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<h1> params[:year] </h1>
|
||||||
|
<h1> <%= @cves_for_year %> </h1>
|
|
@ -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
|
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
||||||
get "/cves", to: "cves#index"
|
get "/cves", to: "cves#index"
|
||||||
get "/cves/:cve_id", to: "cves#show"
|
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", to: "cpes#index"
|
||||||
get "/cpes/:id", to: "cpes#show"
|
get "/cpes/:id", to: "cpes#show"
|
||||||
|
|
Loading…
Add table
Reference in a new issue