Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class CreateBooks < ActiveRecord::Migration[5.0]
  2. def change
  3. create_table :books do |t|
  4. t.string :title
  5. t.string :author
  6. t.string :category
  7. t.text :description
  8. t.text :logo_url
  9. t.string :pdf_file_url
  10.  
  11. t.timestamps
  12. end
  13.  
  14. def get_all_books
  15. # @books = Book.find(2);
  16. @books = Book.where(:id => 1..3)
  17. logger.debug(@books.inspect)
  18. render :json => @books
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement