You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exporting, there is an selectbox to choose which column separator to be used in the csv file generated.
This is not working and will always take the default option of the csv converter.
in lib/rails_admin/config/actions/index.rb we have:
with a params[:csv_options] being for example {encoding_to: "", generator: {col_sep: ";"}}
the method .to_h transforms the keys in strings but the method .to_csv of /lib/rails_admin/support/csv_converter.rb expects to have the option with symbol keys:
When exporting, there is an selectbox to choose which column separator to be used in the csv file generated.
This is not working and will always take the default option of the csv converter.
in
lib/rails_admin/config/actions/index.rb
we have:with a
params[:csv_options]
being for example{encoding_to: "", generator: {col_sep: ";"}}
the method
.to_h
transforms the keys in strings but the method.to_csv
of/lib/rails_admin/support/csv_converter.rb
expects to have the option with symbol keys:I use version rails 4.2.5. Having a look at the documentation of http://devdocs.io/rails~4.2/actioncontroller/parameters
the method to_h sends back a Hash while rails rails 5.0 sends back a HashWithIndifferentAccess (http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-to_h) so I guess using rails 5 will fix the issue.
I guess the solution that would work on any cas would be to transform the
options
parameters inCSVConverter
in aHashWithIndifferentAccess
.The text was updated successfully, but these errors were encountered: