Joe Van Dyk
2007-Jul-12 06:53 UTC
form_tag doesn''t accept a string anymore in edge rails?
So, here''s the offending line. Note that I''m using edge rails. form_tag verifications_path(@user), :method => :post do verifications_path(@user) returns a string like "/users/3/ verifications". That eventually gets sent to url_for, which expects a hash. And then it blows up. It''s especially disconcerting since the documentation shows form_tag as accepting a string. Joe 1) Error: test_new(VerificationsControllerTest): ActionView::TemplateError: can''t convert String into Hash On line #8 of app/views/verifications/new.rhtml 8: <% form_tag verifications_path(@user), :method => :post do %> vendor/rails/actionpack/lib/action_controller/url_rewriter.rb: 38:in `merge'' vendor/rails/actionpack/lib/action_controller/url_rewriter.rb: 38:in `url_for'' vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb: 371:in `html_options_for_form'' vendor/rails/activesupport/lib/active_support/core_ext/object/ misc.rb:23:in `returning'' vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb: 369:in `html_options_for_form'' vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb: 37:in `form_tag'' app/views/verifications/new.rhtml:8:in `_run_rhtml_47app47views47verifications47new46rhtml'' vendor/rails/actionpack/lib/action_view/base.rb:350:in `send'' vendor/rails/actionpack/lib/action_view/base.rb:350:in `compile_and_render_template'' vendor/rails/actionpack/lib/action_view/base.rb:326:in `render_template'' vendor/rails/actionpack/lib/action_view/base.rb:286:in `render_file'' vendor/rails/actionpack/lib/action_controller/base.rb:879:in `render_file'' vendor/rails/actionpack/lib/action_controller/base.rb:780:in `render_with_no_layout'' vendor/rails/actionpack/lib/action_controller/layout.rb:249:in `render_without_benchmark'' vendor/rails/actionpack/lib/action_controller/benchmarking.rb: 51:in `render'' /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' vendor/rails/actionpack/lib/action_controller/benchmarking.rb: 51:in `render'' vendor/rails/actionpack/lib/action_controller/base.rb:1137:in `perform_action_without_filters'' vendor/rails/actionpack/lib/action_controller/filters.rb:695:in `call_filters'' vendor/rails/actionpack/lib/action_controller/filters.rb:687:in `perform_action_without_benchmark'' vendor/rails/actionpack/lib/action_controller/benchmarking.rb: 68:in `perform_action_without_rescue'' /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' vendor/rails/actionpack/lib/action_controller/benchmarking.rb: 68:in `perform_action_without_rescue'' vendor/rails/actionpack/lib/action_controller/rescue.rb:133:in `perform_action_without_caching'' vendor/rails/actionpack/lib/action_controller/caching.rb:668:in `perform_action'' vendor/rails/activerecord/lib/active_record/query_cache.rb:99:in `cache'' vendor/rails/actionpack/lib/action_controller/caching.rb:667:in `perform_action'' vendor/rails/actionpack/lib/action_controller/base.rb:494:in `send'' vendor/rails/actionpack/lib/action_controller/base.rb:494:in `process_without_filters'' vendor/rails/actionpack/lib/action_controller/filters.rb:683:in `process_without_session_management_support'' vendor/rails/actionpack/lib/action_controller/ session_management.rb:122:in `process_without_test'' vendor/rails/actionpack/lib/action_controller/test_process.rb: 15:in `process'' vendor/lib/test/rails/controller_test_case.rb:158:in `process'' vendor/lib/test/rails/controller_test_case.rb:166:in `get'' test/controllers/verifications_controller_test.rb:29:in `test_new'' /opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `__send__'' /opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `run'' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'' /opt/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'' /opt/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in `start_mediator'' /opt/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'' /opt/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'' /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'' /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'' /opt/local/lib/ruby/1.8/test/unit.rb:278 test/controllers/verifications_controller_test.rb:74 1 tests, 0 assertions, 0 failures, 1 errors --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joe Van Dyk
2007-Jul-12 07:27 UTC
Re: form_tag doesn''t accept a string anymore in edge rails?
Nevermind, this was a result of me including UrlWriter into ActionView. On Jul 11, 11:53 pm, Joe Van Dyk <joevan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So, here''s the offending line. Note that I''m using edge rails. > > form_tag verifications_path(@user), :method => :post do > > verifications_path(@user) returns a string like "/users/3/ > verifications". That eventually gets sent to url_for, which expects a > hash. And then it blows up. > > It''s especially disconcerting since the documentation shows form_tag > as accepting a string. > > Joe > > 1) Error: > test_new(VerificationsControllerTest): > ActionView::TemplateError: can''t convert String into Hash > On line #8 of app/views/verifications/new.rhtml > > 8: <% form_tag verifications_path(@user), :method => :post do %> > > vendor/rails/actionpack/lib/action_controller/url_rewriter.rb: > 38:in `merge'' > vendor/rails/actionpack/lib/action_controller/url_rewriter.rb: > 38:in `url_for'' > vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb: > 371:in `html_options_for_form'' > vendor/rails/activesupport/lib/active_support/core_ext/object/ > misc.rb:23:in `returning'' > vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb: > 369:in `html_options_for_form'' > vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb: > 37:in `form_tag'' > app/views/verifications/new.rhtml:8:in > `_run_rhtml_47app47views47verifications47new46rhtml'' > vendor/rails/actionpack/lib/action_view/base.rb:350:in `send'' > vendor/rails/actionpack/lib/action_view/base.rb:350:in > `compile_and_render_template'' > vendor/rails/actionpack/lib/action_view/base.rb:326:in > `render_template'' > vendor/rails/actionpack/lib/action_view/base.rb:286:in > `render_file'' > vendor/rails/actionpack/lib/action_controller/base.rb:879:in > `render_file'' > vendor/rails/actionpack/lib/action_controller/base.rb:780:in > `render_with_no_layout'' > vendor/rails/actionpack/lib/action_controller/layout.rb:249:in > `render_without_benchmark'' > vendor/rails/actionpack/lib/action_controller/benchmarking.rb: > 51:in `render'' > /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > vendor/rails/actionpack/lib/action_controller/benchmarking.rb: > 51:in `render'' > vendor/rails/actionpack/lib/action_controller/base.rb:1137:in > `perform_action_without_filters'' > vendor/rails/actionpack/lib/action_controller/filters.rb:695:in > `call_filters'' > vendor/rails/actionpack/lib/action_controller/filters.rb:687:in > `perform_action_without_benchmark'' > vendor/rails/actionpack/lib/action_controller/benchmarking.rb: > 68:in `perform_action_without_rescue'' > /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > vendor/rails/actionpack/lib/action_controller/benchmarking.rb: > 68:in `perform_action_without_rescue'' > vendor/rails/actionpack/lib/action_controller/rescue.rb:133:in > `perform_action_without_caching'' > vendor/rails/actionpack/lib/action_controller/caching.rb:668:in > `perform_action'' > vendor/rails/activerecord/lib/active_record/query_cache.rb:99:in > `cache'' > vendor/rails/actionpack/lib/action_controller/caching.rb:667:in > `perform_action'' > vendor/rails/actionpack/lib/action_controller/base.rb:494:in > `send'' > vendor/rails/actionpack/lib/action_controller/base.rb:494:in > `process_without_filters'' > vendor/rails/actionpack/lib/action_controller/filters.rb:683:in > `process_without_session_management_support'' > vendor/rails/actionpack/lib/action_controller/ > session_management.rb:122:in `process_without_test'' > vendor/rails/actionpack/lib/action_controller/test_process.rb: > 15:in `process'' > vendor/lib/test/rails/controller_test_case.rb:158:in `process'' > vendor/lib/test/rails/controller_test_case.rb:166:in `get'' > test/controllers/verifications_controller_test.rb:29:in `test_new'' > /opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `__send__'' > /opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:in `run'' > /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'' > /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'' > /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'' > /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'' > /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'' > /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'' > /opt/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in > `run_suite'' > /opt/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in > `start_mediator'' > /opt/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in > `start'' > /opt/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in > `run'' > /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'' > /opt/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'' > /opt/local/lib/ruby/1.8/test/unit.rb:278 > test/controllers/verifications_controller_test.rb:74 > > 1 tests, 0 assertions, 0 failures, 1 errors--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---