Skip to content

Instantly share code, notes, and snippets.

@pyropeter
Created October 7, 2009 23:30
Show Gist options
  • Save pyropeter/204543 to your computer and use it in GitHub Desktop.
Save pyropeter/204543 to your computer and use it in GitHub Desktop.
(Looks like some ruby-on-rails error)
<h1>Listing posts</h1>
<table>
<tr>
<th>Name</th>
<th>Title</th>
<th>Content</th>
</tr>
<% @posts.each do |post| %>
<tr>
<td><%=h post.name %></td>
<td><%=h post.title %></td>
<td><%=h post.content %></td>
<td><%= link_to 'Show', post %></td>
<td><%= link_to 'Edit', edit_post_path(post) %></td>
<td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New post', new_post_path %>
NoMethodError in Posts#new
Showing app/views/posts/new.html.erb where line #3 raised:
undefined method `^' for "4":String
Extracted source (around line #3):
1: <h1>New post</h1>
2:
3: <% form_for(@post) do |f| %>
4: <%= f.error_messages %>
5:
6: <p>
RAILS_ROOT: /home/tristan/projects/rubytests
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:46:in `block in secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `each'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:28:in `verify'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:156:in `unmarshal'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:145:in `load_session'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:62:in `block in load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:70:in `stale_session_check!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:61:in `load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:28:in `[]'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/request_forgery_protection.rb:102:in `form_authenticity_token'
(eval):2:in `form_authenticity_token'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:46:in `block in secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `each'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:28:in `verify'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:156:in `unmarshal'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:145:in `load_session'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:62:in `block in load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:70:in `stale_session_check!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:61:in `load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:28:in `[]'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/request_forgery_protection.rb:102:in `form_authenticity_token'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:476:in `token_tag'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:453:in `extra_tags_for_form'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:461:in `form_tag_html'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:41:in `form_tag'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_helper.rb:281:in `form_for'
/home/tristan/projects/rubytests/app/views/posts/new.html.erb:3:in `_run_erb_app47views47posts47new46html46erb'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/renderable.rb:34:in `block in render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:301:in `with_template'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/renderable.rb:30:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/template.rb:199:in `render_template'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:260:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:343:in `_render_with_layout'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:257:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:1250:in `render_for_file'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:951:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:51:in `block in render_with_benchmark'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:135:in `block in custom'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:179:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:179:in `block in respond'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:173:in `each'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:173:in `respond'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:107:in `respond_to'
/home/tristan/projects/rubytests/app/controllers/posts_controller.rb:29:in `new'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:1331:in `perform_action'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:617:in `call_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/flash.rb:146:in `perform_action_with_flash'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:532:in `process'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:391:in `process'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:386:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:437:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:87:in `dispatch'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:121:in `_call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:29:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:29:in `block in call'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:9:in `cache'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:28:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/head.rb:9:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/params_parser.rb:15:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/failsafe.rb:26:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/lock.rb:11:in `block in call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:114:in `block in call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/reloader.rb:34:in `run'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:108:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rails-2.3.4/lib/rails/rack/static.rb:31:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in `block in call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `each'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rails-2.3.4/lib/rails/rack/log_tailer.rb:17:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/handler/webrick.rb:46:in `service'
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/usr/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:46:in `block in secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `each'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:28:in `verify'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:156:in `unmarshal'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:145:in `load_session'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:62:in `block in load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:70:in `stale_session_check!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:61:in `load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:28:in `[]'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/request_forgery_protection.rb:102:in `form_authenticity_token'
(eval):2:in `form_authenticity_token'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:476:in `token_tag'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:453:in `extra_tags_for_form'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:461:in `form_tag_html'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_tag_helper.rb:41:in `form_tag'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/helpers/form_helper.rb:281:in `form_for'
/home/tristan/projects/rubytests/app/views/posts/new.html.erb:3:in `_run_erb_app47views47posts47new46html46erb'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/renderable.rb:34:in `block in render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:301:in `with_template'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/renderable.rb:30:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/template.rb:199:in `render_template'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:260:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:343:in `_render_with_layout'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:257:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:1250:in `render_for_file'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:951:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:51:in `block in render_with_benchmark'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:135:in `block in custom'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:179:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:179:in `block in respond'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:173:in `each'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:173:in `respond'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:107:in `respond_to'
/home/tristan/projects/rubytests/app/controllers/posts_controller.rb:29:in `new'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:1331:in `perform_action'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:617:in `call_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/flash.rb:146:in `perform_action_with_flash'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:532:in `process'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:391:in `process'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:386:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:437:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:87:in `dispatch'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:121:in `_call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:29:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:29:in `block in call'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:9:in `cache'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:28:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/head.rb:9:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/params_parser.rb:15:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/failsafe.rb:26:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/lock.rb:11:in `block in call'
:8:in `synchronize'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:114:in `block in call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/reloader.rb:34:in `run'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:108:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rails-2.3.4/lib/rails/rack/static.rb:31:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in `block in call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `each'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rails-2.3.4/lib/rails/rack/log_tailer.rb:17:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/rack-1.0.0/lib/rack/handler/webrick.rb:46:in `service'
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/usr/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/usr/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Request
Parameters:
None
Show session dump
---
Response
Headers:
{"Cache-Control"=>"no-cache",
"Content-Type"=>"text/html"}
<h1>New post</h1>
<% form_for(@post) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :content %><br />
<%= f.text_area :content %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', posts_path %>
NoMethodError in Posts#index
Showing app/views/layouts/posts.html.erb where line #12 raised:
undefined method `^' for "4":String
Extracted source (around line #12):
9: </head>
10: <body>
11:
12: <p style="color: green"><%= flash[:notice] %></p>
13:
14: <%= yield %>
15:
RAILS_ROOT: /home/tristan/projects/rubytests
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:46:in `block in secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `each'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:45:in `secure_compare'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/message_verifier.rb:28:in `verify'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:156:in `unmarshal'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:145:in `load_session'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:62:in `block in load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:70:in `stale_session_check!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:61:in `load!'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/session/abstract_store.rb:28:in `[]'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/flash.rb:163:in `flash'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:197:in `flash'
/home/tristan/projects/rubytests/app/views/layouts/posts.html.erb:12:in `_run_erb_app47views47layouts47posts46html46erb'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/renderable.rb:34:in `block in render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:301:in `with_template'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/renderable.rb:30:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/template.rb:199:in `render_template'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:260:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:347:in `_render_with_layout'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_view/base.rb:257:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:1250:in `render_for_file'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:951:in `render'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:51:in `block in render_with_benchmark'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:135:in `block in custom'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:179:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:179:in `block in respond'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:173:in `each'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:173:in `respond'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/mime_responds.rb:107:in `respond_to'
/home/tristan/projects/rubytests/app/controllers/posts_controller.rb:7:in `index'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:1331:in `perform_action'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:617:in `call_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/flash.rb:146:in `perform_action_with_flash'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:532:in `process'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/filters.rb:606:in `process_with_filters'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:391:in `process'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/base.rb:386:in `call'
/home/tristan/.gem/ruby/1.9.1/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:437:in `call'
Request
Parameters:
None
Show session dump
Response
Headers:
{"Cache-Control"=>"no-cache",
"Content-Type"=>"text/html"}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Posts: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold' %>
</head>
<body>
<p style="color: green"><%= flash[:notice] %></p>
<%= yield %>
</body>
</html>
class PostsController < ApplicationController
# GET /posts
# GET /posts.xml
def index
@posts = Post.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
end
end
# GET /posts/1
# GET /posts/1.xml
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @post }
end
end
# GET /posts/new
# GET /posts/new.xml
def new
@post = Post.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post }
end
end
# GET /posts/1/edit
def edit
@post = Post.find(params[:id])
end
# POST /posts
# POST /posts.xml
def create
@post = Post.new(params[:post])
respond_to do |format|
if @post.save
flash[:notice] = 'Post was successfully created.'
format.html { redirect_to(@post) }
format.xml { render :xml => @post, :status => :created, :location => @post }
else
format.html { render :action => "new" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end
end
end
# PUT /posts/1
# PUT /posts/1.xml
def update
@post = Post.find(params[:id])
respond_to do |format|
if @post.update_attributes(params[:post])
flash[:notice] = 'Post was successfully updated.'
format.html { redirect_to(@post) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /posts/1
# DELETE /posts/1.xml
def destroy
@post = Post.find(params[:id])
@post.destroy
respond_to do |format|
format.html { redirect_to(posts_url) }
format.xml { head :ok }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment