Forum: Ruby on Rails form_tag doesn't accept a string anymore in edge rails?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2007-07-12 08:54
(Received via mailing list)
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
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2007-07-12 09:28
(Received via mailing list)
Nevermind, this was a result of me including UrlWriter into
ActionView.
This topic is locked and can not be replied to.