SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    form_tag error -- not found, 404 -- action DOES exist!

    Hi -- I've got a very strange error.
    I have an action called 'commit_input' on a controller called
    'SiteVisitController'. This definately exists, and is called from the
    functional test for it, and passes fine.
    My problem is with the form that is supposed to call this action.
    The form tag is:

    Code:
    <%= form_tag({:action=>'commit_input'}) %>
    
    <%# various controls -- listed in full below -%>
    
    <%= submit_tag 'commit' %>
    <%= end_form_tag %>
    When this is run, I get the page cannot be found screen, and the
    following error in webrick's console:

    127.0.0.1 - - [06/Mar/2006:10:37:30 GMT Standard Time] "GET
    /site_visit/input/1
    HTTP/1.1" 200 153359
    http://localhost:3000/admin/visit_data -> /site_visit/input/1
    #<NoMethodError: undefined method `update' for "0":String>
    ["c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/cgi_ext/
    cgi_methods.rb:116:in `build_deep_hash'",
    "c:/ruby/lib/ruby/gems/1.8/gems/action
    pack-1.9.1/lib/action_controller/cgi_ext/cgi_methods.rb:116:in
    `build_deep_hash'
    ",
    "c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/cgi_ex
    t/cgi_methods.rb:41:in `parse_request_parameters'",
    "c:/ruby/lib/ruby/gems/1.8/g
    ems/actionpack-1.9.1/lib/action_controller/cgi_ext/cgi_methods.rb:39:in
    `each'",
    "c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/cgi_ext/
    cgi_methods.rb:39:in `parse_request_parameters'",
    "c:/ruby/lib/ruby/gems/1.8/gem
    s/actionpack-1.9.1/lib/action_controller/cgi_process.rb:74:in
    `request_parameter
    s'",
    "c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/requ
    est.rb:8:in `parameters'",
    "c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/
    action_controller/base.rb:734:in `assign_shortcuts'",
    "c:/ruby/lib/ruby/gems/1.8
    /gems/actionpack-1.9.1/lib/action_controller/base.rb:351:in `process'",
    "c:/ruby
    /lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:20:in
    `
    process_with_exception'",
    "c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispa
    tcher.rb:34:in `dispatch'",
    "c:/ruby/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/web
    rick_server.rb:105:in `handle_dispatch'",
    "c:/ruby/lib/ruby/gems/1.8/gems/rails-
    0.13.1/lib/webrick_server.rb:71:in `service'",
    "c:/ruby/lib/ruby/1.8/webrick/htt
    pserver.rb:104:in `service'",
    "c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in
    `run'", "c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'",
    "c:/ruby
    /lib/ruby/1.8/webrick/server.rb:144:in `start'",
    "c:/ruby/lib/ruby/1.8/webrick/s
    erver.rb:144:in `start_thread'",
    "c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `
    start'", "c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'",
    "c:/ruby/lib/rub
    y/1.8/webrick/server.rb:89:in `start'",
    "c:/ruby/lib/ruby/1.8/webrick/server.rb:
    79:in `start'", "c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'",
    "c:/ruby
    /lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in
    `dispatch'", "s
    cript/server:49"]
    [2006-03-06 10:37:37] ERROR `/site_visit/commit_input' not found.
    127.0.0.1 - - [06/Mar/2006:10:37:37 GMT Standard Time] "POST
    /site_visit/commit_
    input HTTP/1.1" 404 293
    http://localhost:3000/site_visit/input/1 -> /site_visit/commit_input
    I have been trying to fix this for a couple of days, now, and have tried
    everything I can think of, including explicitly stating the controller
    in the form tag, renaming the action, etc.
    Has anyone else come accross (& hopefully solved) this problem?
    If anyone can shed any light, I would be immensely grateful.
    I'll post the full form code at the bottom of this post.
    Thanks for any & all help,
    doug.


    (Couldn't get the code past the forum filters, sorry.)

  2. #2
    SitePoint Zealot logitron's Avatar
    Join Date
    Feb 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't it suppose to be 'start_form_tag'; not 'form_tag'?
    Patrick Smith
    PHP Programmer

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logitron
    Isn't it suppose to be 'start_form_tag'; not 'form_tag'?
    No, form_tag works fine. I use form_tag and I've never seen this sort of error.... strange. Is this problem on your web host or locally? If it's locally you may wish to reinstall the rails gem (and its dependencies). If your app still doesn't work then you know the error lies within the code of your app itself...
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •