Skip to content

Commit

Permalink
Fix failing to export after introducing Turbo Drive
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Feb 23, 2022
1 parent 50d34c9 commit c749d93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/rails_admin/main/export.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% params = request.params.except(:action, :controller, :utf8, :page, :per_page, :format, :authenticity_token) %>
<% visible_fields = @model_config.export.with(view: self, object: @abstract_model.model.new, controller: self.controller).visible_fields %>
<%= form_tag export_path(params.merge(all: true)), method: 'post', class: "main" do %>
<%= form_tag export_path(params.merge(all: true)), method: 'post', class: "main", data: {turbo: false} do %>
<input name="send_data" type="hidden" value="true" />
<fieldset id="fields_to_export" class="mb-3">
<legend>
Expand Down
6 changes: 6 additions & 0 deletions spec/integration/actions/export_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
is_expected.to have_content @player.team.name
end

it 'works with Turbo Drive enabled', js: true do
visit export_path(model_name: 'player')
page.execute_script 'console.error = function(error) { throw error }'
expect { find_button('Export to csv').trigger('click') }.not_to raise_error
end

it 'exports polymorphic fields the easy way for now' do
visit export_path(model_name: 'comment')
select "<comma> ','", from: 'csv_options_generator_col_sep'
Expand Down

0 comments on commit c749d93

Please sign in to comment.