Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CreateBooks < ActiveRecord::Migration[5.0]
- def change
- create_table :books do |t|
- t.string :title
- t.string :author
- t.string :category
- t.text :description
- t.text :logo_url
- t.string :pdf_file_url
- t.timestamps
- end
- def get_all_books
- # @books = Book.find(2);
- @books = Book.where(:id => 1..3)
- logger.debug(@books.inspect)
- render :json => @books
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement