ruby on rails - Never use Turbolinks to load a specific route -
i know can use data-no-turbolink attribute ensure link (or many links) don't use turbolinks, there way ensure a specific page never loaded via turbolinks?
i have particular page broken when loaded via turbolinks, , instead of employing hacks fix this, i'd rather page load in usual fashion.
i know can add data-no-turbolink links going page, i'd have remember every subsequent link page, pretty hacky.
is there better way?
to modify new , existing urls remove turbolinks specific url, read below:
since you're wanting use "data-no-turbolinks" when linking specific page via link_to, can modify method check url of destination , set data-no-turbolinks attribute.
modify link_to helper (be sure replace route_url , route_path correct variables routes:
# application_helper.rb def link_to(name, path, options = {}) no_turbolink_routes = [route_url, route_path] # add urls/paths here if no_turbolink_routes.include? path options['data-no-turbolinks'] = 'true' end super(name, path, options) end
Comments
Post a Comment