13
votes
5answers
16k views

How to make Ajax calls with Rails 3 using remote_function?

I am trying to make an onchange call on a select box.For my application i am using jquery.js and rails.js as mentioned to make use of UJS. But still the code that is generated is for Prototype and not ...
9
votes
2answers
8k views

Access-Control-Allow-Origin issues

I have two local rails apps that I would like to talk to each other for testing purposes... one is running on port 3000 and the other on 9292. But when I make an ajax request from localhost:3000 to ...
8
votes
2answers
14k views

How do I render partial via ajax in rails3 and jQuery

I could do sth like this in rails 2: def show_rec_horses rec_horses = Horses.find(:all) page["allHorses"].replace_html :partial => "horses/recommended", :locals => {:rec_horses => ...
6
votes
3answers
2k views

How do I append data to a jquery-ujs post request in Rails?

I have an Ajax form with a data-remote="true" attribute which I'm submitting to a controller in rails. What I'd like to do is to use the jquery-ujs event system to append data to the request before ...
6
votes
1answer
3k views

Rendering partial inside js.erb. Is it possible to get raw string so I can strip whitespace?

I want to render a partial in my js.erb file so I can use the generated HTML in my Javascript. Here's some code to serve as an example. create.js.erb $(function(){ var html = "<%= ...
6
votes
2answers
319 views

In place editor with autocomplete

Has anyone been able to do this? Is it possible? I'm writing a Rails 3 app, and it seems like it should be possible to do this with jquery autocomplete and best-in-place, but I haven't seen it.
5
votes
1answer
171 views

javascript function not working in jquery-ajax rails validation error displays

I have a Jquery UI Datepicker function globally to use the calendar in all the pages. I created a seperate javascript page like the following: var showDatePickers = function() { ...
5
votes
1answer
1k views

In Rails how do I handle multiple, polymorphic file uploads with jquery-file-upload and CarrierWave?

In my project I currently have different models (Project, Message, etc) that: has_many :assets, :as => :attachable, :dependent => :destroy Each Asset is basically a model with a CarrierWave ...
5
votes
2answers
284 views

How to trigger download with Rails send_data from AJAX post

I'm trying to use send_data to return a PNG image as the response for a ajax post request. How do I get the browser to trigger a download on the success callback? Details I'm generating a large ...
4
votes
1answer
5k views

Rails Completed 406 Not Acceptable

I don't know what the heck is going on here, I just updated my rails from 3.1.0rc4 to 3.1.0 and I suddenly find that all ajax won't work, It's causing 406 error all the time. Everything was perfectly ...
4
votes
1answer
4k views

jQuery post to Rails

My setup: Rails 3.0.9, Ruby 1.9.2, jQuery 1.6.2 I have a form that shows multiple photos and comments for a user and I wish to implement inline commenting. <div id="newsfeed"> <div> ...
4
votes
4answers
582 views

.on(“click”, function() not working when link rendered with ajax

The link below shows a modal and runs an ajax request to render a partial within the modal based on the object id . The link works fine and the modal pops up when the page is fully loaded with an http ...
4
votes
2answers
2k views

form_tag with remote: true does not make an ajax request

I have many different forms in my app, all of them are using remote: true. But one does not work correctly, because is does not use an ajax call. Cleaned up, it looks like: <%= ...
4
votes
4answers
2k views

jQuery ajax:error runs even if the response is OK 200

I have a form which submit a form via AJAX with :remote => true. Looking at the server log and FireBug, I get the response 200 OK and it returns JSON in the form of: { "email": "[email protected]"} ...
4
votes
2answers
2k views

Uploading multiple files directly to Amazon S3 using Rails 3.2 and AJAX (non-flash upload solutions)

This issue has been bothering me for many hours and I can't seem to find a solution to it. I have a rails 3.2 app that allows users to upload files to an Amazon S3 account using carrierwave_direct, ...

1 2 3 4 5 28
15 30 50 per page