Browse Source

add licenses show

pull/347/head
feng xxq250 1 year ago
parent
commit
e0bc394bd3
2 changed files with 7 additions and 0 deletions
  1. +4
    -0
      app/controllers/licenses_controller.rb
  2. +3
    -0
      app/views/licenses/show.json.jbuilder

+ 4
- 0
app/controllers/licenses_controller.rb View File

@@ -4,4 +4,8 @@ class LicensesController < ApplicationController
q = License.ransack(name_cont: params[:name]) q = License.ransack(name_cont: params[:name])
@licenses = q.result(distinct: true) @licenses = q.result(distinct: true)
end end

def show
@license = License.find(params[:id])
end
end end

+ 3
- 0
app/views/licenses/show.json.jbuilder View File

@@ -0,0 +1,3 @@
json.id @license.id
json.name @license.name
json.content @license.content

Loading…
Cancel
Save