#16 ✓resolved
omarvelous

form_for error - "undefined local variable or method '_erbout'"

Reported by omarvelous | October 23rd, 2008 @ 11:17 AM

Everything works great... until I attempt to add a search form...

Using the following code in my index.htl.erb view...

@@@ Ruby <% form_for @search do |f| %>

<legend>Search People</legend>

<% f.fields_for @search.conditions do |people| %>
    <%= people.text_field :login_keywords %><br />
<% end %>

<%= f.submit "Search" %> <% end %>


I get the following...

NameError in People#index

undefined local variable or method '_erbout' for #<ActionView::Base:0x5ca7d30>

Extracted source (around line #1):

1: <% form_for @search do |f| %> 2:

3: Search People 4:


And the Full Trace...

C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/text_helper.rb:29:in concat_without_haml' C:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.3/lib/haml/helpers/action_view_mods.rb:79:ineval' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/text_helper.rb:29:in concat_without_haml' C:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.3/lib/haml/helpers/action_view_mods.rb:79:inconcat' vendor/plugins/searchgasm/lib/searchgasm/helpers/form.rb:129:in insert_searchgasm_fields' vendor/plugins/searchgasm/lib/searchgasm/helpers/form.rb:124:ineach' vendor/plugins/searchgasm/lib/searchgasm/helpers/form.rb:124:in insert_searchgasm_fields' vendor/plugins/searchgasm/lib/searchgasm/helpers/form.rb:146:infields_for' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/form_helper.rb:253:in form_for_without_haml' C:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.3/lib/haml/helpers/action_view_mods.rb:161:inform_for_without_searchgasm' vendor/plugins/searchgasm/lib/searchgasm/helpers/form.rb:157:in form_for' app/views/people/_basic_search.html.erb:1:inrun_erb_47app47views47people47_basic_search46html46erb' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/base.rb:342:in send' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/base.rb:342:inexecute' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_handlers/compilable.rb:29:in send' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_handlers/compilable.rb:29:inrender' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/partial_template.rb:20:in render' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/benchmarking.rb:26:inbenchmark' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/core_ext/benchmark.rb:8:in realtime' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/benchmarking.rb:26:inbenchmark' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/partial_template.rb:19:in render' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template.rb:22:inrender_template' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/partials.rb:110:in render_partial' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/base.rb:277:inrender_without_haml' C:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.3/lib/haml/helpers/action_view_mods.rb:6:in render' app/views/people/index.html.erb:3:inrun_erb_47app47views47people47index46html46erb' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/base.rb:342:in send' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/base.rb:342:inexecute' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_handlers/compilable.rb:29:in send' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_handlers/compilable.rb:29:inrender' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template.rb:35:in render' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template.rb:22:inrender_template' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/base.rb:248:in render_file' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:1112:inrender_for_file' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:845:in render_with_no_layout' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/layout.rb:251:inrender_without_benchmark' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/benchmarking.rb:51:in render' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/core_ext/benchmark.rb:8:inrealtime' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/benchmarking.rb:51:in render' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:1161:indefault_render' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:1167:in perform_action_without_filters' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/filters.rb:579:incall_filters' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/filters.rb:572:in perform_action_without_benchmark' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue' C:/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/rescue.rb:201:in perform_action_without_caching' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/caching/sql_cache.rb:13:inperform_action' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in cache' C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/query_cache.rb:8:incache' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/caching/sql_cache.rb:12:in perform_action' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:529:insend' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:529:in process_without_filters' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/filters.rb:568:inprocess_without_session_management_support' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/session_management.rb:130:in sass_old_process' C:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.3/lib/sass/plugin/rails.rb:19:inprocess' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:389:in process' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:149:inhandle_request' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:107:in dispatch' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:104:insynchronize' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:104:in dispatch' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:120:indispatch_cgi' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:35:in dispatch' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:76:inprocess' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:74:in synchronize' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:74:inprocess' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:159:in process_client' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:ineach' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in process_client' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:inrun' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in initialize' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:innew' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in run' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:ininitialize' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in new' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:inrun' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:282:in run' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:ineach' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:in run' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:128:inrun' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/command.rb:212:in run' C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281 C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:503:inload' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:503:in load' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:innew_constants_in' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:503:in load' C:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.1/lib/commands/servers/mongrel.rb:64 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:inrequire' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in new_constants_in' C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:inrequire' C:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.1/lib/commands/server.rb:39 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require' C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire' script/server:3



The Parameters...

{"search"=>{"order_as"=>"DESC", "order_by"=>"activated_at"}}


Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson October 23rd, 2008 @ 11:25 AM

    • State changed from “new” to “resolved”

    This should be fixed. I added in a configuration option and make a small mistake. Should be working now.

  • omarvelous

    omarvelous October 23rd, 2008 @ 12:15 PM

    Ehh... IDK...

    Pulled, refreshed, restarted, and still getting the problem....

    Maybe I'm doing something wrong... I'll look over your examples and see...

  • Ben Johnson

    Ben Johnson October 23rd, 2008 @ 12:19 PM

    Your problem is here:

    # For edge rails and older version compatibility, passing a binding to concat was deprecated
    begin
      concat(html)
    rescue ArgumentError
      concat(html, block.binding)
    end
    

    I bet if I catch name errors it would work. Go ahead and pull from the repo, I added that in, let me know if this fixes it.

  • omarvelous

    omarvelous October 23rd, 2008 @ 12:27 PM

    Yup.... that did it.

    I did notice that note when I was looking in your plugin, led me to believe that maybe I need to use an older rails version. Could not readily see what version you used in the examples, and when I installed the gem, it automatically pulled in actionpack 2.1.1 (or was it active_record?), so I just decided to update finally to rails 2.1.1.

    Anywho, this is solved. Hands down, I think this just might be the greatest plugin of them all...

    Great work!

  • Ben Johnson

    Ben Johnson October 23rd, 2008 @ 12:33 PM

    Awesome, glad it worked out, let me know if you have any other issues.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket

Tags

Pages