[Rails] Rendering a partial with ajax/jquery
Hi there i have this issue I have a view that render a partial for each
member inside the object @foo and I have a function for infinite scroll
so the server will be doing request after request while scrolling down
but I don't know exactly how to make this work here is some of my code:
def popular
@foo = Foo.new
respond_to do |format|
response = @foo.popular
...
flash[:notice] = "Welcome."
format.html { render popular_foo_path}
....
end
end
end
views/foo/popular
- @foo.each do |f|
= render(:partial => "popular_foo", :locals => { :foo => f})
views/foo/_popular_foo
- f['thumbs'].each do |thumb|
= image_tag(thumb['thumburl'].to_s, :alt => "thumb", :class =>
"thumb-popular")
every time you scrolldown to certain height a fuction
$(document).infinite_scroll is called and i have it configured to make a
new call to the method popular and I can see in the console and in the
firebug that it do the request and succeed but it won't render the next
results.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home