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

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

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -