public
Last active

  • Download Gist
activities_controller.rb
Ruby
1 2 3
def index
@activities = current_user.activities.search(params[:search]
end
index.html.erb
HTML+ERB
1 2 3 4 5 6 7
<%= 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 %>
production.log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
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'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.