Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

link_to_remote fails with :method => :put

#1040

If you do:

link_to_remote "Update", :url => {:action => "update", :method => :put, :id => @query.id}

It will create a post request with "method"=>"put"

Instead, you need to do:

link_to_remote "Update", :url => {:action => "update", :_method => :put, :id => @query.id}

Reported by Hang · September 13th, 2008 @ 04:54 AM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. James Wilding
    James Wilding

    Don't think this is a bug. I think the proper usage is:

    
    link_to_remote("Update", :url => {:action => "update", :id => @query.id}, :method => :put)
    

    From the Rails API:

    
    link_to_remote(name, options = {}, html_options = nil)
    

    The :method parameter goes in html_options - not with the :url params.

    September 15th, 2008 @ 09:49 AM

  2. Pratik
    Pratik
    • State changed from new to invalid

    December 19th, 2008 @ 02:37 PM