Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Issue 1241 #1580

merged 3 commits into from

4 participants


Improves Pull Request #1302 because $.attr('checked') does not work for reading checked state of a checkbox.
I think this feature is necessary because for large models (de)selecting all fields needs lots of clicks, even when using the existing feature (clicking on the model/relation name).


Coverage decreased (-0.04%) when pulling 1071a0a on DarthMax:issue_1241_fix into 8533e5a on sferik:master.

View Details


Can you please put the JS behavior in the app/assets/javascripts/rails_admin/ file ?


Okay I have moved the stuff to ;)


Coverage decreased (-0.0%) when pulling 85fe0a4 on DarthMax:issue_1241_fix into 8533e5a on sferik:master.

View Details


Nice, thanks!

@bbenezech bbenezech merged commit bb64c94 into sferik:master

1 check failed

Details default The Travis build could not complete due to an error

Hi DarthMax , Thanks for the feature!
I would like to make this select/unselect checkbox work for each field(including the associated fields), could you give me a hint to do this?
I tried but failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
7 app/assets/javascripts/rails_admin/
@@ -68,3 +68,10 @@ $(document).on 'rails_admin.dom_ready', ->
$(".table").tooltip selector: "th[rel=tooltip]"
+$(document).on 'click', '#fields_to_export label input#check_all', () ->
+ elems = $('#fields_to_export label input')
+ if $('#fields_to_export label input#check_all').is ':checked'
+ $(elems).prop('checked', true)
+ else
+ $(elems).prop('checked',false)
7 app/views/rails_admin/main/export.html.haml
@@ -4,7 +4,12 @@
= form_tag export_path(params.merge(:all => true)), :method => 'post', :class => 'form-horizontal denser' do
%input{:name => "send_data", :type => "hidden", :value => "true"}/
- %fieldset
+ %fieldset{:id => 'fields_to_export'}
+ %div.control-group
+ %div.controls
+ %label.checkbox{:for => 'check_all'}
+ = 'Select All Fields'
+ = check_box_tag 'all', 'all', true, { :id => 'check_all' }
= t('')
Something went wrong with that request. Please try again.