Skip to content

Instantly share code, notes, and snippets.

@noahhendrix
Created August 3, 2010 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noahhendrix/506374 to your computer and use it in GitHub Desktop.
Save noahhendrix/506374 to your computer and use it in GitHub Desktop.
def index
@activities = current_user.activities.search(params[:search]
end
<%= semantic_form_for :search, :as => @activities, :html => { :method => :get } do |f| %>
...
<%= f.inputs :name => "in category... " do %>
<%= f.input :category_in, :label => 'Categories', :collection => Activity::CATEGORIES, :as => :check_boxes %>
<% end %>
...
<% end %>
SCREENSHOT: http://imgur.com/Jx66j.png
PARAMETERS:
{"search"=>{"category_in"=>["","Office","Personal","Sales","TradeShow","Event"]},
"commit"=>"Search"}
ERROR:
undefined method `id' for "":String
TRACE:
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1737:in `send_or_call'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1214:in `block in find_selected_values_for_column'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1214:in `map'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1214:in `find_selected_values_for_column'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1164:in `check_boxes_input'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1287:in `inline_input_for'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:108:in `block in input'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:107:in `map'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:107:in `input'
app/views/activities/index.html.erb:87:in `block (3 levels) in _render_template__2180458123110980086_2210526360__2596126518265523900'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `block in capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:169:in `with_output_buffer'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `capture'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1370:in `field_set_and_list_wrapping'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:269:in `inputs'
app/views/activities/index.html.erb:86:in `block (2 levels) in _render_template__2180458123110980086_2210526360__2596126518265523900'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `block in capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:169:in `with_output_buffer'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/form_helper.rb:530:in `fields_for'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/form_helper.rb:308:in `form_for'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1839:in `block in semantic_form_for'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1805:in `with_custom_field_error_proc'
vendor/ruby/1.9.1/bundler/gems/formtastic-7a5120e/lib/formtastic.rb:1838:in `semantic_form_for'
app/views/activities/index.html.erb:74:in `block in _render_template__2180458123110980086_2210526360__2596126518265523900'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `block in capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:169:in `with_output_buffer'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `capture'
app/helpers/layout_helper.rb:88:in `block (2 levels) in content_box'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `block in capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:169:in `with_output_buffer'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/tag_helper.rb:76:in `content_tag'
app/helpers/layout_helper.rb:87:in `block in content_box'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `block in capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:169:in `with_output_buffer'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/capture_helper.rb:37:in `capture'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/helpers/tag_helper.rb:76:in `content_tag'
app/helpers/layout_helper.rb:86:in `content_box'
app/views/activities/index.html.erb:3
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/template.rb:134:in `block in render'
vendor/ruby/1.9.1/gems/activesupport-3.0.0.beta4/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/ruby/1.9.1/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb:48:in `instrument'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/template.rb:126:in `render'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/render/rendering.rb:58:in `block in _render_template'
vendor/ruby/1.9.1/gems/activesupport-3.0.0.beta4/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/ruby/1.9.1/gems/activesupport-3.0.0.beta4/lib/active_support/notifications.rb:48:in `instrument'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/render/rendering.rb:55:in `_render_template'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_view/render/rendering.rb:25:in `render'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/abstract_controller/rendering.rb:114:in `_render_template'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/abstract_controller/rendering.rb:108:in `render_to_body'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/abstract_controller/rendering.rb:101:in `render_to_string'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/abstract_controller/rendering.rb:92:in `render'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/rendering.rb:17:in `render'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb:39:in `block (2 levels) in render'
vendor/ruby/1.9.1/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/noahhendrix/.rvm/rubies/ruby-1.9.2-preview3/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
vendor/ruby/1.9.1/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/benchmark.rb:5:in `ms'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb:39:in `block in render'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb:77:in `cleanup_view_runtime'
vendor/ruby/1.9.1/gems/activerecord-3.0.0.beta4/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/instrumentation.rb:38:in `render'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/mime_responds.rb:258:in `block in retrieve_response_from_mimes'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/mime_responds.rb:189:in `call'
vendor/ruby/1.9.1/gems/actionpack-3.0.0.beta4/lib/action_controller/metal/mime_responds.rb:189:in `respond_to'
app/controllers/activities_controller.rb:21:in `index'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment