search for: xml_http_request

Displaying 15 results from an estimated 15 matches for "xml_http_request".

2008 Sep 10
5
xmlhttprequest for updating
...n update but i always get an argument error when request is done via AJAX. def update: respond_to do |format| if @sample.update_attributes(params[:sample]) flash[:notice] = ''Sample was successfully updated.'' format.html {redirect_to(@sample)} format.xml_http_request :get, "show",:id => @sample else render :action => "edit" end May be i am not using correctly the xml_http_request function. thank you for your help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subs...
2006 Apr 01
3
Gracefully degrading Ajax AND Drying up actions
...e original call and processing the form info (if request.get? ... elsif request.post?). I even know how to have it so the same newpost action can handle the original request and tell if it''s an AJAX request or not, so I can use just one action for AJAX and none AJAX requests (request..xml_http_request?). What I can''t work out to do is how to have it so the processing of the AJAX a form info is done in the same action as the original AJAX call (they are both posts, right?), and it''s forcing me to have a createpost action, just for the AJAX route. If I could work this out, I...
2005 Dec 19
2
Unit/Functional testing for AJAX functions?
I really have no more input than that, so the subject speaks for itself. How do you test that AJAX effects shown in the browser are actually happening? Maybe an auto-complete form field is a good starting example. Sean
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
2009 Jul 14
1
How to add after_filter-style render
...after each of my ajax calls. In example I would like to update some div or display an alert. How I imagine it could work is as follows class ApplicationController < ActionController::Base after_filter :do_something_after_each_ajax_call def do_something_after_each_ajax_call if request.xml_http_request? render :update do |page| page << "alert(''doing something!''); end end end end Of course code above will yield with "Can only render or redirect once per action". How would You approach this problem?
2005 Dec 29
3
Post problem with select lists
...select list?? rhtml First, select a client. <select id="client_id" name="client[id]" onChange="submit();" > <%= options_for_select(@client_options, @client_id.to_i) %> </select><%= @client_id %> controller if @request.post? if @request.xml_http_request? #called by ajax, @client_id = -2 else @client_id = -11#params[:client][:id].nil? ? -11 : params[:client][:id] end else @client_id = -1 end shouldnt it be-11 ??? Output First, select a client. <select id="client_id" name="client[id]" onChange="submit()...
2006 Oct 11
2
Help please with observe_form - not working
...f params[:cat] pq.state_id_in(params[:stat]) if params[:stat] pq.term_id_in(params[:term]) if params[:term] pq.city_in(params[:city].split('','')) if params[:city] pq.title_in(params[:title].split('','')) if params[:title] @positions = pq.find if request.xml_http_request? render :partial => "positions_list", :layout => false end end end -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk&quo...
2007 Mar 08
1
map not displayed after Ajax.updater request
..... @map.overlay_global_init(GMarkerGroup.new(true, @markers[1]), "contact") .... from a radio button, an Ajax.Updater request is sent to my controller to require either table or map build and display... .... ....build table or map ,according to ajax request parameter if request.xml_http_request? render :partial => ''display_network'' , :layout => false end then in my view <% if @display_type == "0" %> .... display table <% else %> <div id="map_box" style="border:solid 2px grey; margin:1em auto; width:340px;...
2005 Apr 19
3
Rails 0.12.1: No major update without a bit of pain
...e, you''ll _definitely_ want to upgrade to 0.12.1 right away. There''s a good handful of fixes for both Action Pack and Active Record (mostly concerning the new eager loading). Here''s the dirt, so you don''t have to go look it up. First for Action Pack: * Added xml_http_request/xhr method for simulating XMLHttpRequest in functional tests #1151 [Sam Stephenson]. Example: xhr :post, :index * Fixed that Ajax.Base.options.asynchronous wasn''t being respected in Ajax.Request (thanks Jon Casey) * Fixed that :get, :post, and the others should take a flash array as the...
2007 Mar 27
1
Ticket #7124
http://dev.rubyonrails.org/ticket/7124 I just attached a patch against 1.2 that cleanly applies to trunk too. This allows functional and integration tests to have the same interface to the xhr/xml_http_request method. The patch also includes a deprecation workaround when called without the appropriate parameters. If the patch could also be applied to the 1.2 branch, I would appreciate. The patch includes tests and comments. There is a bit of duplication within the patch, but I judged this to be OK si...
2005 Dec 01
0
problem with options_from_collection_for_select() need id not name
hey, i need a select list with a id property and not name, cuz i just ajax with this list and it checks on id not name if @request.post? #called by ajax if @request.xml_http_request? #called by ajax @geotag_id=params[:geotag_id].nil? ? -2 : params[:geotag_id] else @geotag_id=params[:geotag][:id].blank? ? -1:params[:geotag][:id] end else @geotag_id = -1 end i use this @geotags = Geotag.find(:all, :conditions =>[''firm_id = ? and client_id = ? '', f...
2010 Oct 02
0
Ajax observe_field not vorking on Rails
...nditions = ["title LIKE ?", "%#{params[:query]}%"] unless params[:query].nil? @total = Message.count(:conditions => conditions) @accounts = Message.paginate :page => params[:page], :per_page => 10, :order => sort, :conditions => conditions if request.xml_http_request? render :partial => "items_list", :layout => false end end I would greatly appreciate any help I can get! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. T...
2008 Jun 09
6
Selenium/Watir usage along side Webrat in story testing
This is related to Selenium/Watir usage along side webrat in story testing. MHS_Testing and Rspec-ui provide some great help for testing through frameworks like Selenium/Watir. But there is something missing, Webrat has changed the landscape somewhat with Acceptance Tests/Story Driven development. Now I have a choice: 1. Tests and rails process run as one test process (Webrat) 2. Use
2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
...st::Unit::TestCase assert_response :success assert_template 'new' - assert_not_nil assigns(:storage_pools) + assert_not_nil assigns(:storage_types) end def test_create_storage_controller @@ -107,7 +107,7 @@ class StorageControllerTest < Test::Unit::TestCase xml_http_request :post, :destroy, :id => storage_pools(:corp_com_dev_nfs_ovirtnfs).id, :format => "json" assert_response :success json = ActiveSupport::JSON.decode(@response.body) - assert_equal 'You do not have permission to create or modify this item ', json['alert'] +...
2006 Apr 11
26
Firefox won''t let me send ''&'' with AJAX!
Hi everyone, I''ve encountered a HUGE problem, which may not be RoR-oriented, but there might be a workaround somehow. See, at this moment, I''m unable to send AJAX requests back and forth when the information contains an ampersand (''&''). In essence, request is never completed. The odd thing is that it only happens with Firefox (IE and Opera works fine).