Siva Ganesh

Joined

50 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in How can I add third party plugin in rails 6?

My application.html.erb looks like this. I just want to remove all cloudfare(cdnjs) external link from application.html.erb. Instead of that I just want to use it in application.js . Because I dont want my application to get load third party plugin every time. If we used it in application.js it will compile for the first time. so my application dont get that much load.

Thanks please assist me

<!DOCTYPE html>
<html lang="en">
  <head>
    <title><%= yield(:title).present? ? yield(:title) : 'Tryblank' %></title>
    <meta name="description" content="<%= yield(:description).present? ? yield(:description) : 'Tryblank' %>" />
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
    <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.6.12/css/lightgallery.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.6.12/js/lightgallery.js" type="text/javascript"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/lg-thumbnail/1.1.0/lg-thumbnail.min.js" type="text/javascript"></script>
  </head>
  <body>
    <%# <p class="notice"> notice</p> <p class="alert">alert</p> %>
    <%= yield %>
  </body>
</html>
logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.