Hi Sergio
Yay ! It works :-)
TQVM for the speedy response :-)
On Wednesday, 1 February 2017 23:43:29 UTC+8, Sergio Cambra wrote:
>
> You are using active_scaffold_export (3.3.2), not github version, change
> Gemfile to:
> gem 'active_scaffold_export', github: 'naaano/active_scaffold_export'
>
> And you will use master branch from github instead of 3.3.2
>
> El miércoles, 1 de febrero de 2017 4:20:23 (CET) Chee Chong Hwa escribió:
> > Hi Sergio
> >
> > I am using 'naaano/active_scaffold_export' ... link from Active_Scaffold
> > wiki
> >
> > On Wednesday, 1 February 2017 19:11:44 UTC+8, Sergio Cambra wrote:
> > > active_scaffold_export 3.3.2 is outdated, it doesn't work with latest
> > > activescaffold. Use github: 'naaano/active_scaffold_export' because no
> new
> > > version has been released yet
> > >
> > > El miércoles, 1 de febrero de 2017 0:12:58 (CET) Chee Chong Hwa
> escribió:
> > > > 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.