turbolinks-5

Rails turbolinks 5 flash messages

北战南征 提交于 2019-12-08 16:27:37
问题 I am trying to find a way to deal with rails (v4.1) flash messages when using turbolinks 5. I tried adding data-temporary="true" to each flash message div and then something like: $(document).on('turbolinks:before-cache', function () { $('[data-temporary]').remove(); }); so old flash messages aren't cached and won't be shown the next time the user accesses that same page. However, that has left me with an issue on pages where I'm using flash.now because on these pages the flash has been

Rails 5 on heroku forgets files stored with paperclip and turbolinks: No route matches

て烟熏妆下的殇ゞ 提交于 2019-12-04 06:26:09
问题 I have a blog with file up-/download via paperclip 5.1.0 and turbolinks 5.0.1. Upload without validation works fine now, but download is only working for a short period after upload. Afterwards an error (404) is displayed: The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you are the application owner check the logs for more information. This did not help: heroku rake db:migrate heroku restart I am on production with mysql DB on

Rails 5 on heroku forgets files stored with paperclip and turbolinks: No route matches

邮差的信 提交于 2019-12-02 08:19:15
I have a blog with file up-/download via paperclip 5.1.0 and turbolinks 5.0.1. Upload without validation works fine now, but download is only working for a short period after upload. Afterwards an error (404) is displayed: The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you are the application owner check the logs for more information. This did not help: heroku rake db:migrate heroku restart I am on production with mysql DB on heroku. When I am not deploying via heroku: then the local copy works just fine with ruby version 2.2.4!

Turbolinks unfriendly?

雨燕双飞 提交于 2019-12-01 11:45:30
I totally get why Turbolinks 5 is awesome and if you're reading it, you probably do as well, but I am very frustrated with how badly it plays with the other scripts on the block. To date, there is no simple explanation (human readable) that shows how to wrap existing jQuery scripts in a way that would allow them to function. Take for example this one: https://github.com/Bttstrp/bootstrap-switch . It's well written, simple to understand. You load the js and css to your assets pipeline and instantiate it on some page. # view.html.erb <input type="checkbox" class="switch"> switch button <script

Turbolinks unfriendly?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 10:52:41
问题 I totally get why Turbolinks 5 is awesome and if you're reading it, you probably do as well, but I am very frustrated with how badly it plays with the other scripts on the block. To date, there is no simple explanation (human readable) that shows how to wrap existing jQuery scripts in a way that would allow them to function. Take for example this one: https://github.com/Bttstrp/bootstrap-switch. It's well written, simple to understand. You load the js and css to your assets pipeline and