added controller and view for github_poc
This commit is contained in:
parent
b91923a9e4
commit
bc06defa7c
4 changed files with 23 additions and 0 deletions
16
app/controllers/github_pocs_controller.rb
Normal file
16
app/controllers/github_pocs_controller.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
class GithubPocsController < ApplicationController
|
||||
def index
|
||||
@pocs = GithubPoc.all
|
||||
end
|
||||
|
||||
def show
|
||||
@poc = GithubPoc.find_by(:id => params[:id])
|
||||
render json: @poc.to_json
|
||||
end
|
||||
|
||||
def show_for_cve
|
||||
@poc = GithubPoc.where(:cve_id => params[:cve_id])
|
||||
render json: @poc.to_json
|
||||
end
|
||||
|
||||
end
|
1
app/views/github_pocs/index.html.erb
Normal file
1
app/views/github_pocs/index.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>GithubPocs#index</h1>
|
2
app/views/github_pocs/show.html.erb
Normal file
2
app/views/github_pocs/show.html.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
<h1> @poc </h1>
|
||||
|
|
@ -6,4 +6,8 @@ Rails.application.routes.draw do
|
|||
|
||||
get "/cpes", to: "cpes#index"
|
||||
get "/cpes/:id", to: "cpes#show"
|
||||
|
||||
get "/github_pocs", to: "github_pocs#index"
|
||||
get "/github_pocs/:id", to: "github_pocs#show"
|
||||
get "/github_pocs/cve/:cve_id", to: "github_pocs#show_for_cve"
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue