domenica 31 maggio 2009

Rails, form_remote_tag, method GET

This is not a bug, just a reminder for me on HowTo set up a form_remote_tag with method GET on Rails, I'm using version 2.2.2
The only things bugged here is the documentation bevause is not very intuitive. There are a lot of examples but none about setting the method to GET. This snippet sets the ajax request and the html request to GET. Don't forget to set both to get, otherwise you'll have a for with an ajax get and a html post, POST is the DEFAULT.

     form_remote_tag  :url => blasts_path,
                        :method => :get,
                        :html => {:method=> :get},
                        :update => { :success => "succeed", :failure => "fail"} do 

....YOUR CODE  HERE....

       select("sm","id", {"SeMe clusters"=>"1", "All clusters"=>"0"}) 
       submit_tag "Search", :name => nil 
    end 

      
    

Nessun commento:

Posta un commento