RailsCasts Pro episodes are now free!

Learn more or hide this

Sean Linsley's Profile

GitHub User: seanlinsley

Site: gittip.com/seanlinsley

Comments by Sean Linsley

Avatar

That totally exists now. They're called Batch Actions :]

Avatar

Kind of. It will sort by the ids of the parent model, instead of something more useful (like alphabetical sorting).

Avatar

Perhaps because you're not using the add function? The below format works fine for me.

ruby
validate :name_must_be_cool

def name_must_be_cool
  errors.add(:name, 'Try again!') unless is_cool?(name)
end
Avatar

The command rails g active_admin:resource product doesn't actually create a model; it just creates the app/admin/products.rb file so Active Admin renders a GUI for this resource when you start your server. You've got to run rails g model product first.

Avatar

Assigning before_create (etc) callbacks in your model work just fine with ActiveAdmin. What exactly is your problem?