search for: xhr

Displaying 20 results from an estimated 186 matches for "xhr".

Did you mean: shr
2006 Jun 24
5
request.xhr? vs. respond_to
Searched around this forum, but didn''t find an answer for this question. Can you help this newbie understand any overlap and/or difference between request.xhr? and respond_to? If request.xhr? is true, should I expect it wants.js below? respond_to do |wants| wants.html { redirect_to(person_list_url) } wants.js wants.xml { render :xml => @person.to_xml(:include => @company) } end Is it fair to say the functionality of res...
2006 Mar 16
23
AJAX on Mobile Internet Explorer
Hi! I try to get AJAX running on a mobile Windows Mobile 5.0 based device and failed. There should be a JavaScript support but nothing happens. Have any of you experience with the rails javascripts on a this platform or are there any hints, documentation on the net? tia, -- Daniel V?lkerts Protected by Anti Pesto.
2007 Apr 26
2
assert_select with respond_to JS or xhr?
Hi everyone, I am a bit confused with xhr? and respond_to. I have the folloing code in my view to update the ''emails'' ID link_to_remote(image_tag("refresh"), :update => "emails", :url => { :action => "list_emails" }) in the controller side i have somthing like : [..] respond_t...
2006 Jul 12
3
request.xhr? is false after redirecting an AJAX request?
Dear everybody I''m trying to develop a web application that makes use of AJAX, but also works if a user has no (or doesn''t want to use) JS. For normal requests, this is pretty easy. Almost every action ends with render blahblah, :layout => !request.xhr? This way, I can use the same action to render a full page (with layout) as well as rendering an AJAX request (only the div, no layout) The problem occurs when doing a redirect_to in an AJAX request (e.g. if a form post request was successful and the user is redirected to the list action). The...
2008 Jun 05
2
xhr :post giving wrong number of arguments on rails 2.1?
Getting a strange error. In a story I have the following step: When "I submit a search name" do xhr :post, ''/searches'', {:search => {:given_name => "bob", :family_name => "smith"}} end I am getting: ArgumentError: wrong number of arguments (4 for 3) stories/searching_story_spec.rb:45 in "I submit a search name" But I only have 3 argument...
2008 Mar 31
1
How to make a ajax (xhr) redirect?
Hi all, In my application, I want seamless degradability so I use request.xhr? to check whether a request is an ajax call. However here and there, I need to use redirect_to - in this case the request is not xhr anymore, and the check doesn''t work as expected. Is there a way to make xhr- like redirect (which allow to get to another controller+action)? Thanks, - Chuo...
2006 May 31
0
Help with xhr request in integration tests
Hello, The documentation at api.rubyonrails.com for ActionController::TestProcess#xhr or xml_http_reponse gives method as the first parameter and action as the second parameter folled by the parameters hash, etc. But ActionController::Integration::Session#xhr has a path, followed by the parametes hash, and apparently no alias for xhr. Of course, the documentation in the AWDwR book...
2005 Dec 15
2
link_to_remote and browser compatibility
link_to_remote generates the javascript: new Ajax.Updater(...). Have I missed something or doesn''t this handle browsers with javascript support but without XHR support? What I''d like to do is: 1. If the browser supports XHR, use XHR 2. If the browser supports javascript (and perhaps even if the XHR request fails) do a POST via javascript 3. If the browser doesn''t support javascript use POST via a standard form Is that possible? Than...
2006 Jul 26
4
How to Firebug XHR/AJAX requests
Saw a lot of recommendations for Firebug (http://www.joehewitt.com/software/firebug/) on this list. I''ve scanned its docs and tried it--many useful features. But I''m so dense that I can''t get it to spy XHR/AJAX requests and their response on FC5 running Firefox 1.5.0.4 and Firebug 0.4. Can someone tell me how to get to http://www.joehewitt.com/software/firebug/screens/spy.png ? Thanks in advance! Doug. -- Posted via http://www.ruby-forum.com/.
2006 Mar 22
3
Parent-Child Tables Help
...# (ex: redirect_to :controller => ''AdminConsole'', :action => ''index'') redirect_to :action => ''index'' end def list @cars = Car.find :all render :layout => false end def new @car = Car.new if request.xhr? @temp_id = Time.new.to_i @headers[''car-id''] = @temp_id @headers[''Content-Type''] = ''text/html; charset=utf-8'' render :layout => false # If you want to send an error message: # render :inline => "E...
2006 Apr 01
3
Gracefully degrading Ajax AND Drying up actions
Still a semi-newbie, but so far I''ve managed to solve most things with a bit of help from the Agile book, some googling around, and a bit of trial-and-error, but I''m really stuck with this one (very much an Ajax newbie): I know how to gracefully degrade an AJAX newpost type call so it can appear inline or (for those without JS support) go to a new page (put an ":href
2006 Jul 06
1
multiple xhr requests
Hi I have a window that looks like this -------------------- | | Enter -------------------- That box will take a command that the user enters and runs it on a server in the background loading a new window for the user to view the results. Is there a way to take multiple xhr requests so that the next request the user enters , a new window will pop up right away, instead of stalling for the first xhr request to finish? thanks -- Posted via http://www.ruby-forum.com/.
2007 Jun 27
2
Controller specs not shareable?
Hi I just wondered if there was a reason why Rails controller specs are not shareable? eg describe "All XHR POSTs to /gap/calculate_quote", :shared => true do controller_name :gap # ... end describe "XHR POST /gap/calculate_quote with valid details" do it_should_behave_like "All XHR POSTs to /gap/calculate_quote" # ... end blows up with the following error:...
2007 Dec 03
8
automatic 'verify :xhr => true' for methods ending with _xhr
hey guys, i am writing a couple of actions which are only used with an xhr. I ''protect'' them all against a direct access with the ''verify'' method in the controller verify :only => ..., :xhr => true it would be cool if the system would automatically recognize the xhr actions and protect them ... i want to postfix methods with ...
2007 Feb 08
3
testing ajax responder actions
I have an Ajax responder method which uses respond_to to make sure it only works with Ajax. I''m having trouble figuring out how to call this action successfully. I''m using Rails 1.2.x. Any thoughts? -- Cheers, Kevin Williams http://www.almostserio.us/ "Any sufficiently advanced technology is indistinguishable from Magic." - Arthur C. Clarke
2009 Oct 14
6
Reinstantiate controller during functional testing
...a select box, I select an item from the drop down list, see another select box show up, go back to the first select box, select a different item, and see something different happen. I have tried to script this up in my functional test with something like this: test "blah blah blah" xhr :post, :add_lot_to_assembly, :id => lots(:lot_one).to_param, :use_part => parts(:part_three).to_param assert_response :success xhr :post, :add_lot_to_assembly, :id => lots(:lot_one).to_param, :use_part => parts(:part_two).to_param...
2006 Jul 24
0
Redirect/rendering out of xhr
Hi, I have a link_to_remote to an action in my controller, which has an rjs file associated with it. In the action (where @request.xhr? is true), I have tried to redirect to another page or render to another page. When I do this, the log says all the redirections/renders were successful, but I remain on the same page. My rjs file at least does not execute though, which is good. Any ideas on what''s going on? -- Respectfu...
2007 Jan 03
0
submit_form for Ajax via xhr
...s a submit_form method that reads your current page''s form, and submits all its fields with their data. This works great for Test Driven Development because it tests your current page''s form and your controller''s action at the same time. Is there a submit_form that calls xhr, to submit a FORM thru Ajax? How easy would that be to add? -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To...
2010 Oct 18
0
Ajax call-request.xhr? = false Rails 3
...or:") %> <%= text_field_tag("query", params[:query], :autocomplete => "off", :onKeyPress=>"return disableEnterKey(event)") %> <%= submit_tag("Search", :name => nil, ) %> On reaching the controller in question request.xhr? is = to false Anyone has any ideas why? or what am I doing wrong. I have prototype.js and rails.js files loaded in my layout files. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrai...
2010 Sep 21
7
Ajax CSRF in Rails3
I''m using rails3. It does not seem to check the authenticity_token when doing a POST using Ajax. I traced this to: module ActionDispatch class Request < Rack::Request ..... def forgery_whitelisted? get? || xhr? || content_mime_type.nil? || ! content_mime_type.verify_request? end end so you don''t check if its a get? or a xhr? (ie ajax request). Is this correct? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this...