turbolinks

fullcalendar dynamically change default view based on screen width

こ雲淡風輕ζ 提交于 2020-01-25 06:53:28
问题 I'm using fullcalendar and the below code works for me to render fullcalendar while also using turbolinks. function eventCalendar() { return $('#event_calendar').fullCalendar({ defaultView: 'agendaWeek', header: { left: 'prev,today,next', center: 'title', right: 'agendaDay,agendaWeek' }, }); }; function clearCalendar() { $('#event_calendar').fullCalendar('delete'); // In case delete doesn't work. $('#event_calendar').html(''); }; $(document).on('turbolinks:load', eventCalendar); $(document)

Turbolinks with carrierwave images as CSS background-image

馋奶兔 提交于 2020-01-22 13:56:19
问题 I've been using turbolinks along this year but lately I'm getting this annoying bug. Images uploaded via carrierwave are loaded in the site with absolute URL's in the first request, but when you start browsing in the site via turbolinks, all carrierwave images change to relative paths. <%= image_tag "image.jpg %> elements work ok, but the images are loaded as CSS background-image, they don't appear. This apparently happens only on chrome (I have Versión 31.0.1650.57 m). I made a trace via

dropdowns only trigger once

匆匆过客 提交于 2020-01-17 10:38:09
问题 I have two filter dropdowns on this site which will only trigger the first time I press them. According to my studies it seems that it has to do with turbolinks, which I've disabled by adding data-no-turbolink to the body tag like so: <body data-no-turbolink> ... </body> I've also tried adding this to all of the dropdown links and the link to open the dropdown. <a href="some-link" data-no-turbolink>...</a> It seems to work on development, but when I push to Heroku, it seems turbolinks are

How can I prevent duplicate wrappers on a jQuery DataTable when navigating back in the presence of Turbolinks?

烂漫一生 提交于 2020-01-14 14:51:44
问题 I'm using jQuery DataTables in a new Rails 4.2 project. I've got a large number of results that need to be filtered on group, project, and status. Choosing the group filters the project selection, via a roundtrip through the application, and the project selection filters the table the same way. I save the group & project in session variables so that, when the user changes pages, then clicks the main link to come back, it will remember their selection, and get them back to where they were.

How can I prevent duplicate wrappers on a jQuery DataTable when navigating back in the presence of Turbolinks?

谁都会走 提交于 2020-01-14 14:51:09
问题 I'm using jQuery DataTables in a new Rails 4.2 project. I've got a large number of results that need to be filtered on group, project, and status. Choosing the group filters the project selection, via a roundtrip through the application, and the project selection filters the table the same way. I save the group & project in session variables so that, when the user changes pages, then clicks the main link to come back, it will remember their selection, and get them back to where they were.

Can you use turbolinks with webpack in rails?

陌路散爱 提交于 2020-01-13 17:00:15
问题 This post provides an excellent tutorial on how to replace the rails asset pipeline with webpack. However, it states that you should remove the turbolinks gem. Is there a way to do this and still use turbolinks? 回答1: You can use it directly from NPM https://www.npmjs.com/package/turbolinks and follow the provided documentation. Here is the doc https://www.npmjs.com/package/turbolinks#installation-using-npm This the same as when you use Turbolinks in other frameworks. 回答2: You will need to

turbolinks issues with bootstrap modal

痞子三分冷 提交于 2020-01-09 19:53:47
问题 I doing a modal like this: Link that shows the modal: <%= link_to "versão resumida", resumed_rep_life_animal_path(animal, :partial => true), 'data-toggle' => 'modal', 'data-target' => '#myModal', 'data-no-turbolink' => true %> Modal html itself: <div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-body"></div> <div class="modal-footer"> <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"

turbolinks issues with bootstrap modal

旧街凉风 提交于 2020-01-09 19:53:27
问题 I doing a modal like this: Link that shows the modal: <%= link_to "versão resumida", resumed_rep_life_animal_path(animal, :partial => true), 'data-toggle' => 'modal', 'data-target' => '#myModal', 'data-no-turbolink' => true %> Modal html itself: <div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-body"></div> <div class="modal-footer"> <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"

Rails 4: disable Turbolinks in a specific page

白昼怎懂夜的黑 提交于 2020-01-09 06:05:10
问题 I'm trying to make a JS snippet work in a concrete page with Rails 4 and Turbolinks. I've tried with the standard solution: <script type="text/javascript"> var ready = function() { // Bla bla }; $(document).ready(ready); $(document).on('page:load', ready); </script> But it doesn't seem to work. My snippet is something like this: <script type="text/javascript"> function ismready() { var API_KEY = "api key"; var roomId = "room id"; var ism = new Ismuser(API_KEY, roomId); ism.init({ board: {

Rails 4: disable Turbolinks in a specific page

ε祈祈猫儿з 提交于 2020-01-09 06:02:47
问题 I'm trying to make a JS snippet work in a concrete page with Rails 4 and Turbolinks. I've tried with the standard solution: <script type="text/javascript"> var ready = function() { // Bla bla }; $(document).ready(ready); $(document).on('page:load', ready); </script> But it doesn't seem to work. My snippet is something like this: <script type="text/javascript"> function ismready() { var API_KEY = "api key"; var roomId = "room id"; var ism = new Ismuser(API_KEY, roomId); ism.init({ board: {