Guest User

Untitled

a guest
Apr 24th, 2018
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. 001_create_products.rb
  2.  
  3. class CreateProducts < ActiveRecord::Migration
  4. def self.up
  5. create_table :products do |t|
  6. t.column :title, :string
  7. t.column :description, :text
  8. t.column :image_url, :string
  9. end
  10. end
  11. def self.down
  12. drop_table :products
  13. end
  14. end
  15.  
  16. admin_controller.rb
  17.  
  18. class AdminController < ApplicationController
  19. scaffold :product
  20. end
  21.  
  22. database.yml
  23.  
  24. development:
  25. adapter: mysql
  26. encoding: utf8
  27. database: depot_development
  28. username: root
  29. password: password
  30.  
  31. test:
  32. adapter: mysql
  33. encoding: utf8
  34. database: depot_test
  35. username: root
  36. password: password
  37.  
  38. production:
  39. adapter: mysql
  40. encoding: utf8
  41. database: depot_production
  42. username: root
  43. password: password
Add Comment
Please, Sign In to add comment