简体   繁体   中英

how can we create partials in active admin for index panel

I want to create a partials to render some data in index panel for different namespaces for DRY

I am currently writing

 index do
    render 'index', user: :user    
 end
//_index.html.arb
column :id
column 'Customer Name', :name
column :mobile
column :recipient_number    
column :cash_in_hand do |customer|
  number_to_currency(customer.cash_in_hand, unit: "\u20B9", precision: 2)
end
column "Due Balance" do |customer|      
  number_to_currency(customer.due_balance, unit: "\u20B9", precision: 2)
end
actions

I want to create a partials to render some data in index panel for different namespaces for DRY

I am currently writing

 index do
    render 'index', user: :user    
 end
//_index.html.arb
column :id
column 'Customer Name', :name
column :mobile
column :recipient_number    
column :cash_in_hand do |customer|
  number_to_currency(customer.cash_in_hand, unit: "\u20B9", precision: 2)
end
column "Due Balance" do |customer|      
  number_to_currency(customer.due_balance, unit: "\u20B9", precision: 2)
end
actions

I want to create a partials to render some data in index panel for different namespaces for DRY

I am currently writing

 index do
    render 'index', user: :user    
 end
//_index.html.arb
column :id
column 'Customer Name', :name
column :mobile
column :recipient_number    
column :cash_in_hand do |customer|
  number_to_currency(customer.cash_in_hand, unit: "\u20B9", precision: 2)
end
column "Due Balance" do |customer|      
  number_to_currency(customer.due_balance, unit: "\u20B9", precision: 2)
end
actions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM