I want to list all the records from DB, which are all active(true) in my index page.
I'm using active scaffold plugin with rails 2.3.8. any suggestion how to add active condition in my controller?
here is my admin controller
class Admin::AccountsController < ApplicationController
active_scaffold :accounts do |config|
config.list.sorting = {:id => :asc}
config.list.columns = [:description,:year]
config.actions = [:create, :update,:list,:search,:delete]
end
end
Models
class Account < ActiveRecord::Base
has_many :customer_accounts
end
class CustomerAccount < ActiveRecord::Base
belongs_to :account
end
Table structure
create_table :customer_accounts do |t|
t.integer :account_id
t.active :boolean, :default=>true
t.timestamps
end