Closed balajibalasubramaniam closed 6 years ago
when I print @filterrific.select_options, then in the console I get the following: {\"sorted_by\"=>[[\"Name (a-z)\", \"name_asc\"], [\"Commited date (newest first)\", \"created_at_desc\"], [\"Commited date (oldest first)\", \"created_at_asc\"], [\"Category (a-z)\", \"country_name_asc\"]], \"with_country_id\"=>[[\"Australia\", 3], [\"Canada\", 2], [\"Ireland\", 7], [\"New Zealand\", 5], [\"Puerto Rico\", 6], [\"South Africa\", 4], [\"United Kingdom\", 8], [\"United States\", 1]]}
@balajibalasubramaniam in the printout of .select_options, you can see that the Hash uses string keys. So in order to make this work, you need to change @filterrific.select_options[:with_country_id]
to @filterrific.select_options["with_country_id"]
. Notice the String hash key for "with_country_id".
Hi, I am trying to run filterrific in jruby rails environment. Initially, there was no errors and was able to run it succesffully. Few days after that I was working on different controller adding some other gems related with charts. When I came to student controller, now it is giving me this error, I have triple verified all the code and also did beyond compare with your demo app and mine. There was no changes in views, controller, model, js, db and config files, but suddenly I am getting this error "undefined method `empty?' for nil:NilClass" in the following line
Can you please help?
Application Trace
app/views/students/index.html.haml:22:in
block in _app_views_students_index_html_haml___1163931893_2080' app/views/students/index.html.haml:12:in
_app_views_students_index_html_haml___1163931893_2080'Full Trace
actionview (5.1.1) lib/action_view/helpers/tags/select.rb:36:in
grouped_choices?' actionview (5.1.1) lib/action_view/helpers/tags/select.rb:20:in
render' actionview (5.1.1) lib/action_view/helpers/form_options_helper.rb:163:inselect' actionview (5.1.1) lib/action_view/helpers/form_options_helper.rb:817:in
select' app/views/students/index.html.haml:22:inblock in _app_views_students_index_html_haml___1163931893_2080' haml (5.0.1) lib/haml/helpers.rb:382:in
block in capture_haml' haml (5.0.1) lib/haml/helpers.rb:667:inwith_haml_buffer' haml (5.0.1) lib/haml/helpers.rb:378:in
capture_haml' haml (5.0.1) lib/haml/helpers/xss_mods.rb:62:incapture_haml_with_haml_xss' haml (5.0.1) lib/haml/helpers/action_view_mods.rb:45:in
capture_with_haml' actionview (5.1.1) lib/action_view/helpers/form_helper.rb:450:inform_for' haml (5.0.1) lib/haml/helpers/action_view_xss_mods.rb:29:in
form_for_with_haml_xss' filterrific (2.1.2) lib/filterrific/action_view_extension.rb:23:inform_for_filterrific' app/views/students/index.html.haml:12:in
_app_views_students_index_html_haml___1163931893_2080' actionview (5.1.1) lib/action_view/template.rb:157:inblock in render' activesupport (5.1.1) lib/active_support/notifications.rb:168:in
instrument' actionview (5.1.1) lib/action_view/template.rb:352:ininstrument_render_template' actionview (5.1.1) lib/action_view/template.rb:155:in
render' actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:52:inblock in render_template' actionview (5.1.1) lib/action_view/renderer/abstract_renderer.rb:42:in
block in instrument' activesupport (5.1.1) lib/active_support/notifications.rb:166:inblock in instrument' activesupport (5.1.1) lib/active_support/notifications/instrumenter.rb:21:in
instrument' activesupport (5.1.1) lib/active_support/notifications.rb:166:ininstrument' actionview (5.1.1) lib/action_view/renderer/abstract_renderer.rb:41:in
instrument' actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:51:inblock in render_template' actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:59:in
render_with_layout' actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:50:inrender_template' actionview (5.1.1) lib/action_view/renderer/template_renderer.rb:14:in
render' actionview (5.1.1) lib/action_view/renderer/renderer.rb:42:inrender_template' actionview (5.1.1) lib/action_view/renderer/renderer.rb:23:in
render' actionview (5.1.1) lib/action_view/rendering.rb:103:in_render_template' actionpack (5.1.1) lib/action_controller/metal/streaming.rb:217:in
_render_template' actionview (5.1.1) lib/action_view/rendering.rb:83:inrender_to_body' actionpack (5.1.1) lib/action_controller/metal/rendering.rb:52:in
render_to_body' actionpack (5.1.1) lib/action_controller/metal/renderers.rb:141:inrender_to_body' actionpack (5.1.1) lib/abstract_controller/rendering.rb:24:in
render' actionpack (5.1.1) lib/action_controller/metal/rendering.rb:36:inrender' actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:44:in
block in render' activesupport (5.1.1) lib/active_support/core_ext/benchmark.rb:12:inblock in ms' /home/balaji/Documents/balaji/unl/PhD/railswebapp/jruby-9.1.10.0/lib/ruby/stdlib/benchmark.rb:308:in
realtime' activesupport (5.1.1) lib/active_support/core_ext/benchmark.rb:12:inms' actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:44:in
block in render' actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:87:incleanup_view_runtime' activerecord (5.1.1) lib/active_record/railties/controller_runtime.rb:29:in
cleanup_view_runtime' actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:43:inrender' actionpack (5.1.1) lib/action_controller/metal/implicit_render.rb:33:in
default_render' actionpack (5.1.1) lib/action_controller/metal/basic_implicit_render.rb:4:inblock in send_action' org/jruby/RubyKernel.java:1747:in
tap' actionpack (5.1.1) lib/action_controller/metal/basic_implicit_render.rb:4:insend_action' actionpack (5.1.1) lib/abstract_controller/base.rb:186:in
process_action' actionpack (5.1.1) lib/action_controller/metal/rendering.rb:30:inprocess_action' actionpack (5.1.1) lib/abstract_controller/callbacks.rb:20:in
block in process_action' activesupport (5.1.1) lib/active_support/callbacks.rb:131:inrun_callbacks' actionpack (5.1.1) lib/abstract_controller/callbacks.rb:19:in
process_action' actionpack (5.1.1) lib/action_controller/metal/rescue.rb:20:inprocess_action' actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:32:in
block in process_action' activesupport (5.1.1) lib/active_support/notifications.rb:166:inblock in instrument' activesupport (5.1.1) lib/active_support/notifications/instrumenter.rb:21:in
instrument' activesupport (5.1.1) lib/active_support/notifications.rb:166:ininstrument' actionpack (5.1.1) lib/action_controller/metal/instrumentation.rb:30:in
process_action' actionpack (5.1.1) lib/action_controller/metal/params_wrapper.rb:252:inprocess_action' activerecord (5.1.1) lib/active_record/railties/controller_runtime.rb:22:in
process_action' actionpack (5.1.1) lib/abstract_controller/base.rb:124:inprocess' actionview (5.1.1) lib/action_view/rendering.rb:30:in
process' actionpack (5.1.1) lib/action_controller/metal.rb:189:indispatch' actionpack (5.1.1) lib/action_controller/metal.rb:253:in
dispatch' actionpack (5.1.1) lib/action_dispatch/routing/route_set.rb:49:indispatch' actionpack (5.1.1) lib/action_dispatch/routing/route_set.rb:31:in
serve' actionpack (5.1.1) lib/action_dispatch/journey/router.rb:46:inblock in serve' org/jruby/RubyArray.java:1734:in
each' actionpack (5.1.1) lib/action_dispatch/journey/router.rb:33:inserve' actionpack (5.1.1) lib/action_dispatch/routing/route_set.rb:832:in
call' rack (2.0.3) lib/rack/etag.rb:25:incall' rack (2.0.3) lib/rack/conditional_get.rb:25:in
call' rack (2.0.3) lib/rack/head.rb:12:incall' torquebox-web-3.2.0 (java) lib/torquebox/session/servlet_store.rb:47:in
call' actionpack (5.1.1) lib/action_dispatch/middleware/cookies.rb:613:incall' activerecord (5.1.1) lib/active_record/migration.rb:556:in
call' actionpack (5.1.1) lib/action_dispatch/middleware/callbacks.rb:26:inblock in call' activesupport (5.1.1) lib/active_support/callbacks.rb:97:in
run_callbacks' actionpack (5.1.1) lib/action_dispatch/middleware/callbacks.rb:24:incall' actionpack (5.1.1) lib/action_dispatch/middleware/executor.rb:12:in
call' actionpack (5.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:59:incall' actionpack (5.1.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in
call' railties (5.1.1) lib/rails/rack/logger.rb:36:incall_app' railties (5.1.1) lib/rails/rack/logger.rb:24:in
block in call' activesupport (5.1.1) lib/active_support/tagged_logging.rb:69:inblock in tagged' activesupport (5.1.1) lib/active_support/tagged_logging.rb:26:in
tagged' activesupport (5.1.1) lib/active_support/tagged_logging.rb:69:intagged' railties (5.1.1) lib/rails/rack/logger.rb:24:in
call' sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:incall' actionpack (5.1.1) lib/action_dispatch/middleware/remote_ip.rb:79:in
call' actionpack (5.1.1) lib/action_dispatch/middleware/request_id.rb:25:incall' rack (2.0.3) lib/rack/method_override.rb:22:in
call' rack (2.0.3) lib/rack/runtime.rb:22:incall' activesupport (5.1.1) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in
call' actionpack (5.1.1) lib/action_dispatch/middleware/executor.rb:12:incall' actionpack (5.1.1) lib/action_dispatch/middleware/static.rb:125:in
call' rack (2.0.3) lib/rack/sendfile.rb:111:incall' railties (5.1.1) lib/rails/engine.rb:522:in
call'