It's still not dynamically updating.
<!-- Modal -->
<div class="modal fade reusable_modal" id="myModal"
tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<%= image_tag(post.user.avatar_url(:thumb), class:
'round-image-50') %>
<%= post.user.username %>
<h4 class="modal-title" id="myModalLabel"></h4>
</div>
<div class="modal-body">
<%= image_tag(post.photo.url(:large), style: 'max-width:
570px;') %>
<%= sanitize content_with_emoji(post.body) %>
</div>
<div class="modal-footer">
<h5>Hello Test</h5>
</div>
</div>
</div>
</div>
$(document).on('page:change', function(){
// shims for the Bootstrap Modal, which is bloody-minded about
caching content per modal
$(document).on('click', '#reusable_modal
[data-dismiss="modal"]',
function (e) {
$(e.target).removeData('bs.modal');
$('#reusable_modal').find('.modal-content').empty();
});
$(document).on('click', '[data-target="#reusable_modal"]',
function(e)
{
$("#reusable_modal").find(".modal-content").load($(this).attr("href"));
});
});
--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/18f6730352886b04c644a6c82a2a58c4%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment