Tagged Questions
15
votes
4answers
13k views
Submit form in rails 3 in an ajax way (with jQuery)
I am a beginner in rails and jQuery. I have two separate forms in one page and I want to submit them separately in ajax way (with jQuery). This is how far I got. Can anybody add or fix this code to ...
9
votes
1answer
3k views
Devise session immediately expiring on .js call [AJAX]
Through much trial and error, I have narrowed the problem down to line 5 below. For some reason, the .js response is ending the user session. Using 3.0.4 and devise 1.1.7 (and jQuery 1.5).
...
5
votes
2answers
5k views
Rails 2 to Rails 3 : using link_to instead of link_to_remote (including remote and update)
A quick and easy answer I'm sure.
I'm upgrading a Rails project from version 2 to version 3 and replacing a load of the link_to_remote with link_to's as per the Rails 3 update. Even something as ...
17
votes
1answer
12k views
rails3 rails.js and jquery catching success and failure of ajax requests
Previously, in rails 2.3.8 i used the prototype-helpers link_to_remote and form_remote_for (amongst others).
These had the option :update as follows:
link_to_remote "Add to cart",
:url => { ...
2
votes
3answers
1k views
Rails 3 rateable model - How to create ajax rating?
How do I create some simple ajax rating like there is on this page http://watir.com/documentation/ ? Every visitor should be able to rate, I dont need to set permissions. I want to store the ratings ...
2
votes
2answers
1k views
How to have Ajax spinner show on specific page?
I'm having issues showing my ajax spinner. Right now I am testing this on my localhost:3000/test with the following code:
I click a link to get the loader to show (Ruby on Rails code):
...
12
votes
3answers
20k views
Rails 3 AJAX remote form call backs
I'm upgrading from rails 2.3.8 to 3.0.0, so I need to replace the remote_form_for helper calls with form_for(@object, :remote=>true).
I've been following along with Simone Carletti but I cant seem ...
4
votes
1answer
5k views
How to use the jQuery AJAX request and the Ruby on Rails 'render' method togheter?
I am using Ruby on Rails 3.0.7 and jQuery 1.6.1 and I would like to know how to handle response xhr, status and ex variables after an AJAX request.
The AJAX request is:
$jQuery.ajax({
type: ...
5
votes
2answers
1k views
rails ajax fav button for user posts
I have queried on user posts (nested resources, obviously) and have a long list of posts from different users. I would like the user to be able to click a little star next to each post to favorite ...
5
votes
1answer
3k views
Devise + Rails 3.0.4 ends session after AJAX request
I have an action triggered by an AJAX request generated by Ajax.InPlaceEditor or InPlaceCollectionEditor like this:
new Ajax.InPlaceCollectionEditor('agent_email', 'inspections/<%= @inspection.id ...
3
votes
3answers
1k views
How to upgrade the :update=>'div_id' option of remote_form_for from Rails 2 to Rails 3?
I can't figure out how to upgrade this code from Rails 2 to Rails 3:
<% remote_form_for(item, :update => 'div_id') do |f| %>
...
I tried this:
<%= form_for :item, :remote => true, ...
7
votes
2answers
4k views
Simple like/unlike button with rails 3, jquery, and ajax
I have a product, user, and like model. A user can like a product. I am trying to implement a simple like button which, upon a click, allows a user to like a product. Then the like button transforms ...
0
votes
1answer
101 views
Issue with Ajax Appending
I have a comment model that is paginated and I would like the comments to load more comments on the same page whenever the next button is clicked. I have somewhat of an idea of how to go about doing ...
1
vote
1answer
3k views
How to replace the div in Rails 3 using AJAX?
I was trying to replace my div in DOM using RJS. Here is the code i tried,
The controller has this method:
def change
render :update do |page|
page.replace(:test_id, :partial => ...
0
votes
3answers
538 views
Ajax call in rails 3.2.3 with will_paginate gem
Im trying to implement an Ajax call with the will_paginate gem, I found this guide http://ramblinglabs.com/blog/2011/11/rails-3-1-will_paginate-and-ajax which seemed like a simple solution, though it ...