I am new to Rails and ActiveAdmin.
I would like to have an interface similar to Django admin with my applications, so I can manage products and other things.
As long as I have the admin_users URL where I can add or remove admin users in my application, this is great.
I use Rails 3 and I was wondering if I can add a new menu besides Users so that I can manage other models from dashboard
I tried rails generate active_admin:resource Product
It creates the product.rb file on app/admin/ , but it does not work, this is my Product product.rb model
class Product < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me belongs_to :category has_many :line_items has_many :orders, through: :line_items validates_presence_of :category_id, :name, :price_cents attr_accessible :avatar has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png" validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/ attr_accessor :price attr_accessible :category_id, :description, :image, :name, :price_cents, :upc_code, :price, :taxable def price price_cents/100.0 if price_cents end def price= price self.price_cents = (price.to_f*100).round end end
I don’t know what am I doing wrong?
Any ideas?