similar to: Rails 3 basic Get JSON with jQuery and output on the page flow question

Displaying 20 results from an estimated 10000 matches similar to: "Rails 3 basic Get JSON with jQuery and output on the page flow question"

2010 Nov 06
0
Rails and JQuery and Ajax/Json question
Hi, I am using JQuery in my rails app. I''ve taken the approach outlined in Ryan Bates''s Railscast on jquery to do the following: jQuery.ajaxSetup({ ''beforeSend'' : function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} }); to set my ajax call request Headers to text/javascript so that my respond to block for javascript is
2008 Sep 25
2
jquery, format.js and IE
I''m trying to use jQuery to write all my js unobtrusively, and running into a bit of a problem when triggering the format.js block in IE6 (and possibly IE7). It returns the JSON string no problem, but instead of parsing it, IE6 asks to download the resource as a .js file. So if my url is ''/pictures/1.js'', IE6 will ask to save or run ''1.js'' I did do
2012 Sep 22
1
formtastic does not save at all
Rails 3.1.3 I am using Formtastic gem in order to deal with multi-select dependencies. <%= semantic_form_for(@give) do |f| %> <%= f.inputs do %> <%= f.input :departure, :collection => Departure.find(:all, :order=>:city).collect{ |c| [c.city,c.id]}, :required=>true %> <div id="destinationCity"> <%= render :partial =>
2010 May 28
0
Rails and JSON example?
Does anyone know of a demo or tutorial in which ... (1) In a browser some data is packaged up using JSON. (2) an async request is sent to a rails app sending the JSON data. I would like this to be done via jQuery. (3) A rails app deserializes the JSON data. (4) The Rails app then packages up some other data using JSON, again (5) The Rails app sends this data back to the browser. (6) jQuery
2010 Sep 23
8
HowTo; Rails 3, having Tabs that load content via jQuery ... No Page Refesh
Hello, I''m interested in learning the correct/smart approach for implementing a web page with tabs and a content panel... When the tab is clicked by the user the tab''s content is fetched and inserted with jQuery... no page refresh... Example, Facebook, when you click Photos or Events, it doesn''t refresh the browser, just replaces the content with AJAX in the
2013 Jul 19
0
Integrate jquery Grantt with my app in rails
Hi! I made a app in rails and have registed somethings... i would integrate jquery grantt with my app in rails. https://github.com/robicch/jQueryGantt Its is the project jqueryGrantt, he generate a json. I think that i could build a JSON with rails and integrate with the grantt... but, how? Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys, I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9. Sadly, rails 3 no longer has javascript generators and I''m now forced to do more javascript. For my project, I have selected jQuery as the javascript framework for my rails 3.0.9 app. What I have done to have my app''s deletion link (for each item) trigger an alert box when the deletion
2012 Feb 20
1
respond_to format.json not being called
Hi all, I''m submitting a form using jQuery, but in the respond_to block only the format.html action is called. This is the javascrip: send_button.on(''click'', function(){ var form = $(this).closest(''.modal'').find(''form''); $.post(''/messages'', form.serialize(), function(data, status, xhr){
2010 Jun 24
0
Rails3: render_to_string of a .html.erb when request is a json request raises MissingTemplate error
I''ve the following situation (which actually works in Rails 2.3.8 and this is a result of the migration of our app to rails3): I have a partial which is rendered a few times (imagine tr''s in a table). On the clientside there''s a script that does a json request for a specific row (jQuery + ajax dataType: ''json'' and type: ''POST'') In
2010 Oct 31
0
Error in rendering json
Hello, in my controller I use following code to render json. render :json => @product, :callback => params[:callback] I would expect (for example) following to be rendered: callback({"name":"Computer","price":500}) Instead, it renders: callback([{"name":"Computer","price":500}]) Notice the square brackets which disables
2011 Nov 18
0
Jquery dialog
Hi, i had a index page with url as www.exa,com/users/jude.In that page i want to submit a from which appears from popup dialog.The action of the popup is going to send_message,Whenever i submits, via ajax the data gets stored but not the page gets reflected. My controller def send_message @message = current_user.messages.build(params[:message]) @message.receiver_id = @user.id
2010 Sep 21
0
Upload form with uploadify jquery plugin
I would like to integrate the uploadify plugin with a standard rails form. However I can''t figure out how to add a new field and have it get submitted with the file upload. I added a name field into the form, but the valued does not get submitted. <% dialog_file_description = ''Photos'' allowed_extensions = [:jpg, :jpeg, :gif, :png] max_size = 20.megabyte
2013 Mar 28
1
Error Empty file upload result - problem with jQuery bulk file upload
I have problems with multiple file upload. I tried Paperclip with jQuery file uplad plugin and get the error mentioned in the title. Files get uploaded without problems, but I keep getting this embarrassing error. Can somebody offer a solution to my problem or suggest alternative solution that can be implemented in 2 hours? My client is getting a bit uneasy now. I have tried everything I
2013 Jan 16
0
Rails 3.2 jQuery JSONP request not working - Moved Permanently
I am trying to send a POST request ( ''remove_tag_named'' )and getting a simple OK back on success ; it doesn''t work.. the post is correctly sent , but after then it''s looping on sending a GET request to the same url, with the error 301 Moved Permanently I should not be far fro the solution, but I am stuck : In my routes.rb *namespace
2011 Jul 30
2
Get the current user as Json with Devise
Hi! I use Devise and Basic HTTP Authentication to access user areas from a mobile app. When the user enters its details in the app and it tries to "login" (you don''t actually login with basic auth as you send the credentials with each request) I want to get a response back with the user info, like user ID, email (not password) etc. - So, is there a way to do this out of
2012 Jun 21
1
ActiveModel::Serializers::JSON support arbitrary keys
Is there a reason why AM:S doesn''t support arbitrary keys to serialization? I can see a lot of uses cases where arbitrary keys could come handy. Right now, if one tries to do it, AM:S checks if the keys match a method of the model and raises exception if it can''t find any. class Client < ActiveRecordBase attr_accessible :name, :address, as: :creator include
2013 May 27
6
Headache with Ajax in Rails using jQuery
Hello everyone, I''m a newbie at Ruby on Rails. I spent nearly two days of the Memorial Day weekend stumbling upon making Ajax working in Rails. At this point, I''m so exhausted and hope that I can get some help to move forward. I have tried nearly everything I found on Google but still not successful. Initially, I tried the Ajax approach offered by Rails but did not work, so I
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
2010 Sep 17
0
Key Value Json ActiveModel::Errors
Hi all, I''m using Rails 3.0, and I have a model which validates if the attribute :name is present. On my my views, I use Jquery to submit the form which creates the model. If the name is not present, Rails returns something like this Json: [''Name is a required value''] Is there a way to make it return something like this? [''name'': ''Name is a
2010 Nov 17
1
How to enable div that was hide using JQuery
I Have used Ajax and JQuery link to enable new and close functionality problem scenario: * While using ajax link to open the new content and closing the same using Jquery link its working fine wherein the same does not happen again while we try to open the new content immediately after closing the "New content" * The above said works fine only while we refresh the page How to resolve it