Skip to content

Instantly share code, notes, and snippets.

@reiro
Created May 19, 2015 07:52
Show Gist options
  • Save reiro/aa8b223d6abe52633a35 to your computer and use it in GitHub Desktop.
Save reiro/aa8b223d6abe52633a35 to your computer and use it in GitHub Desktop.
Active admin
gem 'activeadmin', github: 'activeadmin'
gem 'devise'
gem 'cancan' # or cancancan
gem 'draper'
gem 'pundit'
rails g scaffold Product name price:decimal category:references
rails g scaffold Category name
rake db:migrate
Category.create name: "Книги"
Category.create name: "Видео игры"
Category.create name: "Диски"
Product.create name: "Programming Ruby", price: 13.92, category_id: 1
Product.create name: "Властелин колец", price: 20.22, category_id: 1
Product.create name: "Programming Rails4", price: 3.52, category_id: 1
Product.create name: "Fallout", price: 15.00, category_id: 2
Product.create name: "Generals", price: 12.55, category_id: 2
Product.create name: "Gotica", price: 9.99, category_id: 2
Product.create name: "Хиты 90", price: 5.92, category_id: 3
Product.create name: "Хиты 80", price: 4.22, category_id: 3
Product.create name: "Руки вверх", price: 2.52, category_id: 3
rails g active_admin:install
rake db:migrate
rails g active_admin:resource Product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment