Form_tag doesn't accept a string anymore in edge rails?


#1

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:inurl_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:inreturning’
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:inform_tag’
app/views/verifications/new.rhtml:8:in
_run_rhtml_47app47views47verifications47new46rhtml' vendor/rails/actionpack/lib/action_view/base.rb:350:insend’
vendor/rails/actionpack/lib/action_view/base.rb:350:in
compile_and_render_template' vendor/rails/actionpack/lib/action_view/base.rb:326:inrender_template’
vendor/rails/actionpack/lib/action_view/base.rb:286:in
render_file' vendor/rails/actionpack/lib/action_controller/base.rb:879:inrender_file’
vendor/rails/actionpack/lib/action_controller/base.rb:780:in
render_with_no_layout' vendor/rails/actionpack/lib/action_controller/layout.rb:249:inrender_without_benchmark’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:
51:in render' /opt/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:
51:in render' vendor/rails/actionpack/lib/action_controller/base.rb:1137:inperform_action_without_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:695:in
call_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:687:inperform_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:inmeasure’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:
68:in perform_action_without_rescue' vendor/rails/actionpack/lib/action_controller/rescue.rb:133:inperform_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:incache’
vendor/rails/actionpack/lib/action_controller/caching.rb:667:in
perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:494:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:494:in
process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:683:inprocess_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:inprocess’
vendor/lib/test/rails/controller_test_case.rb:158:in process' vendor/lib/test/rails/controller_test_case.rb:166:inget’
test/controllers/verifications_controller_test.rb:29:in test_new' /opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:insend
/opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:in run' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:inrun’
/opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in each' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:inrun’
/opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in run' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:ineach’
/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:inrun_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:instart’
/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:inrun’
/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


#2

Nevermind, this was a result of me including UrlWriter into
ActionView.