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


Let's say I run all the necessary values ​​(for multiple columns) in a hash. I want to use this hash in many columns. I do not want to repeat the code for each column. Where and how to write this common code?

Rail provides a solution that can be a solution:

  ActiveAdmin.register User Index Column (with ID) - Option Category: "Highlight" | opts | Opts.column (: name) opts.column (: Email) opts.column (: last_ip) End column ( : Created_at) and end  

Comments

Popular posts from this blog

mysql - How to enter php data into a html multiple select box -

java - Can't add JTree to JPanel of a JInternalFrame -

c++ - Cassandra datastax cpp driver - avoiding unnecessary copies -