NoMethodError in EmployeesController#export
undefined method `active_scaffold_includes' for 
#<EmployeesController:0xa132008>
Extracted source (around line *#45*):

43
44
45
46
47
48
              

      @export_columns = export_config.columns.reject { |col| 
params[:export_columns][col.name.to_sym].nil? }
      includes_for_export_columns = @export_columns.collect{ |col| col.includes 
}.flatten.uniq.compact
      self.active_scaffold_includes.concat includes_for_export_columns
      @export_config = export_config
      # Make sure active_scaffold's find_page is dealing with the same list of
      # columns. Prevents an invalid SQL query when exporting after filtering

Rails.root: C:/RubymineProjects/pms4mysql
Application Trace <http://localhost:3000/employees/export#> | Framework 
Trace <http://localhost:3000/employees/export#> | Full Trace 
<http://localhost:3000/employees/export#>

active_scaffold_export (3.3.2) lib/active_scaffold/actions/export.rb:45:in 
`export' <http://localhost:3000/employees/export#>
actionpack (5.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in 
`send_action' <http://localhost:3000/employees/export#>
actionpack (5.0.1) lib/abstract_controller/base.rb:188:in `process_action' 
<http://localhost:3000/employees/export#>
actionpack (5.0.1) lib/action_controller/metal/rendering.rb:30:in 
`process_action' <http://localhost:3000/employees/export#>
actionpack (5.0.1) lib/abstract_controller/callbacks.rb:20:in `block in 
process_action' <http://localhost:3000/employees/export#>
activesupport (5.0.1) lib/active_support/callbacks.rb:126:in `call' 
<http://localhost:3000/employees/export#>
activesupport (5.0.1) lib/active_support/callbacks.rb:126:in `call' 
<http://localhost:3000/employees/export#>


Steps to repeat

1. added active_support_export after active_scaffold in gem file

2. bundle install successfully

3. added to employees_controller config block

conf.actions.add :export
# you can filter or sort columns if you want
conf.export.columns = %w(eno ename dept date_join)
# you can define a default values for the exporting form
#conf.export.default_deselected_columns = %w(phone address)
conf.export.default_delimiter = ";"
conf.export.force_quotes = "true"
conf.export.default_file_format = 'csv' # or 'xlsx'

4. Click export icon

5. accepted default in Export dialog and click export


Any assistance is much appreciated

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to