It looks like turbolinks problem which are added to rails 4 by default. In turbolinks $(document).ready is not always firing. You can see more information about turbolinks and some suggestions how to use them here railscast or you can add to some links
data: { no_turbolink: true }
You can also just remove the turbolinks from gemfile if you don't need them. Also check if you have the ui-icons_ef8c08_256x240.png in
/assets/images/