similar to: Ajax call-request.xhr? = false Rails 3

Displaying 20 results from an estimated 4000 matches similar to: "Ajax call-request.xhr? = false Rails 3"

2010 Oct 11
0
Converting observe_field to UJS in Rails 3
I am trying to rewrite my website in Rails 3 and Ruby 1.9.2. Can some one help me convert my observe_field which is working under Rails 2.3.5 to Rails 3. I would like to avoid using JQuery as over the last year everything I have tried in JQuery has failed, including this one. Perhaps due to my lack of knowledge. I would not like to install the legacy upgrade. What I have in my website is several
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
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, - Chuong
2011 May 05
1
Array params in form_tag
Hello i have a lot of time trying to figure this out. I am having problem sending array params with form_tag :remote=>true form.erb <%#= form_tag reporte_client_reports_path do%> <%= form_tag reporte_client_reports_path,:remote=>true do%> <p> <%= label_tag :cuts %> <%= select_tag "cuts[]", options_from_collection_for_select(@cuts,
2009 Apr 12
3
Multi-button form
It cannot be this difficult, especially in rails. Here is my form code in a partial for the index action of a controller: <% form_tag({:controller => controller_name, :action => ''index''}, {:method => :get, :class => ''form''}) do %> <div class="columns"> <div class="column left"> <p>
2007 Jan 03
0
submit_form for Ajax via xhr
Railsters: The assert_select system has 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
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
2008 Dec 18
0
A question about text_field_tag value
This is my rails code: <%= label_tag ''user_name_label'', ''User Name:'' %> <%= text_field_tag ''user_name'', ''''%> <%= label_tag ''view_name_label'', ''View Name:''%> <%= text_field_tag ''view_name'', '''' %> I defined a user name text field
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 would tend to
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_to do |type| type.html { render :action
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
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
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 ''_xhr'' and
2008 Jan 24
0
ActiveResource or Ajax/XHR + REXML or similar for calling ashx webservice
Hi! I''m making an application to display logs that are returned from an external resource as XML. I''d like to use ActiveResource, but from what I understand it can''t be done out of the box, because the WS I''m calling doesn''t conform to the URI conventions. To log on to the service, I''ll have to call something like
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
2006 Mar 08
4
Event.Observer - (was: Ajax.Autompleter not working on IE)
See if I can stir up a little life with a demo. I can''t believe that Ajax.Autocomplete doesn''t work on IE, so I *must* be doing something wrong. Trying to figure this out I added some alerts to control.js and it seems that IE is not getting the onkeypress events. So, here''s a demo: http://hank.org/demos/form.html That contains two fields with onkeypress events:
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
2006 Feb 13
2
[PATCH] Allow generic autocompleter (Ajax.Watcher)
Hey. Below is a patch to allow generic Ajax.Autocompleters. Basically it''s for people who wanna be able to watch an input for changes, but don''t want it to pop up an autocompleter box below. Useful for live previews, that kind of thing. Someone''s gonna have to fix the tabstops. I couldn''t be arse to work out how to make vim do the softtabs properly. Spaces for
2013 Sep 19
0
CRUD model in a bootstrap modal with jquery, ajax - best practice
Hi, i have an model, which i want to show edit and update in a dialog via ajax. What i do at the moment: To open the Modal and render the partial, i send an ajax request to controller#show with ujs this is the link: <a class="person-dialog" data-remote="true" data-type="script" href="/en/people/32" onclick="return false">Fidel
2006 May 03
3
Graceful degrading AJAX show/hide
Ok i''ve done a bit of hunting around and I can''t find much documentation on how ensure an ajax call through an rjs file degrades with javascript off. Essentially, if javascript is off, I want to refresh the page and pass a variable from the controller to the page the user is on. Not use the rjs file. At the moment i have this: <%= link_to_remote("Advanced Search",