Twitter bootstrap modal loads wrong remote data
Posted
by
Victor S
on Stack Overflow
See other posts from Stack Overflow
or by Victor S
Published on 2012-10-27T22:57:25Z
Indexed on
2012/10/27
23:00 UTC
Read the original article
Hit count: 255
I'm using Twitter Bootstrap modal featurs and loading data from remote locations. I'm providing the remote url for a set of thumbnails with the hope that once the thumbnail is clicked, the appropriate data (a large version of the image) is displayed. I'm using the html declarative style to define the remote urls and all the features of the modal.
What I find is that Twitter bootstrap modal loads first remote url then does not display subsequent remote data, (although a request to the proper url is made in Chrome) but displays first loaded data always. How do I get it to show the proper data?
View:
#gallery-navigation
%ul
- @profile.background_images.each do |image|
%li
= link_to image_tag(image.background_image.url(:thumb)), remote_image_path(image.id), :role => "button", :data => {:toggle => "modal", :target => "#image-modal", :remote => remote_image_path(image.id)}, :id => "image-modal"
/ Modal
#image-modal.modal.hide.fade(role="dialog" aria-hidden="true" data-backdrop="true")
.modal-body
Controller:
def remote_image
@image = current_user.profile.background_images.find(params[:image_id])
respond_to do |format|
format.html {
render :partial => "remote_image", :locals => { :image => @image }
}
end
end
© Stack Overflow or respective owner