Skip to content

Instantly share code, notes, and snippets.

@amolpujari
Created October 23, 2013 05:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amolpujari/7112906 to your computer and use it in GitHub Desktop.
Save amolpujari/7112906 to your computer and use it in GitHub Desktop.
activeadmin tweaks
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