Insert page specific CSS or JS using content_for
19-Nov-2020 1295
There might be cases where you want to insert some CSS or JS snippet into a specific page only , for example inserting Stripe JS and CSS only on the payment page, but not on other pages of the same controller.If you insert the snippet into layout/application.html.erb , it will be available to all the pages, which might slow down the load time of other pages which doesn’t use the script!.
Insert page specific CSS or JS using content_for #ruby #rubydeveloper #rubyonrails #Insert #specific #using #content_for #css https://rubyonrails.ba/link/insert-page-specific-css-or-js-using-content_for