parent
3521fbeff9
commit
82d80edaca
@ -0,0 +1,6 @@
|
|||||||
|
class LibraryTagsController < ApplicationController
|
||||||
|
def index
|
||||||
|
library_tags = LibraryTag.all
|
||||||
|
render_ok(library_tags: library_tags.as_json(only: %i[id name]), count: library_tags.size)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
class AddLibraryTagData < ActiveRecord::Migration[5.2]
|
||||||
|
def up
|
||||||
|
execute 'INSERT INTO library_tags(id, name) VALUES(4, "高校案例")'
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
execute 'DELETE FROM library_tags WHERE id = 4 and name = "高校案例"'
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue