javascript - Mansory works only after refreshing (jquery) (Ruby on rails) -
my posts.js.coffee $ -> $('#posts').masonry itemselector: '.box' $container = $('#posts') $container.imagesloaded -> $container.masonry() return return work after refreshing page, otherwise have posts in 1 column. 1 after other. can do? answers i solved problem using jquery-turbolinks gem when configured app jquery-turbolinks documentation mansory gem works well!