rails_admin导出未运行

时间:2015-07-06 09:47:35

标签: ruby-on-rails rails-admin

我正在尝试在rails_admin中使用导出功能。如果单击导出按钮,将显示以下错误:

48         %i.icon-chevron-down
49         = t('admin.export.options_for', name: 'csv')
50       .form-group.control-group
51         - guessed_encoding = @abstract_model.encoding
52         %label.col-sm-2.control-label{for: "csv_options_encoding_to"}=  t('admin.export.csv.encoding_to')
53         .col-sm-10.controls
54           -# from http://books.google.com/support/partner/bin/answer.py?answer=30990 :

错误的参数数量(0表示1)

提取的来源(第51行附近):

@NotNull

任何想法如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我通过评论第51和56行解决了这个问题。

50 .form-group.control-group 
51 -# guessed_encoding = @abstract_model.encoding 
52 %label.col-sm-2.control-label{for: "csv_options_encoding_to"}= t('admin.export.csv.encoding_to') 
53 .col-sm-10.controls 
54 -# from http://books.google.com/support/partner/bin/answer.py?answer=30990 : 
55 = select_tag 'csv_options[encoding_to]', options_for_select(RailsAdmin::CSVConverter::TARGET_ENCODINGS), include_blank: true 
56 -# %p.help-block= t('admin.export.csv.encoding_to_help', name: guessed_encoding)