Created
October 23, 2013 05:12
-
-
Save amolpujari/7112906 to your computer and use it in GitHub Desktop.
activeadmin tweaks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdmin | |
module Views | |
class IndexAsTable < ActiveAdmin::Component | |
include CustomHelper | |
def column_select resource, attr, list | |
val = resource.send(attr) | |
html = _select list, val, { "attrs" => %{ | |
data-path='#{resource.class.name.tableize}' | |
data-attr='#{attr}' | |
data-resource-id='#{resource.id}' | |
class='admin-selectable' | |
} | |
} | |
html.html_safe | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment