ruby on rails 4 - How to write a common code block which can be used across multiple columns in index method of activeadmin -



ruby on rails 4 - How to write a common code block which can be used across multiple columns in index method of activeadmin -

lets drive required values(for multiple columns) in hash.i want utilize hash across multiple columns. don't want repeat code each column.where , how write mutual code ?

rails provides method with_options might solution:

activeadmin.register user index column(:id) with_options class: "highlight" |opts| opts.column(:name) opts.column(:email) opts.column(:last_ip) end column(:created_at) end end

ruby-on-rails-4 activeadmin

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -