admin_data
admin_data copied to clipboard
Create custom hooks as a column
As per the wiki, we are able to create new columns, for proc'd data, as per the example:
config.columns_order = { 'User' => [:id, :phone_numbers] }
config.column_settings = {'User' => { :phone_numbers => lambda {|model| model.phone_numbers.map {|r| r.number}.join(', ') } } }
Is it possible to create a completely new column that doesn't exist as model to provide a hook into our application? As per the following:
config.columns_order = { 'User' => [:id, :custom_hook_column] }
config.column_settings = {'User' => { :custom_hook_column => 'my_app_hook_path/' + :id } }
It should be possible to create a new column that does not really exist as a column in the table.
If you run into any problem then let me know and I will look into this issue.
I'm getting an undefined method for "custom_hook_column" at admin_data-1.1.10/app/views/admin_data/search/search/_listing.html.erb where line #29
I will look into this tonight.