Closed agustinmono closed 4 years ago
You can add links to your js and css by adding links to them in the <head>
tag here:
~/greenlight/app/views/layouts/application.html.erb
Or you can just add the js files to ~/greenlight/app/assets/javascripts
and css to ~/greenlight/app/assets/stylesheets
Great!, but if I add the js files to ~/greenlight/app/assets/javascripts do I need to declare the new files to the compiler or something? Thanks
The javascript no. Rails should automatically pickup on the new file and include it. For the css, you'll need to add a reference to the file you added in ~/greenlight/app/assets/stylesheets/application.scss
I just dropped the js files into
~/greenlight/app/assets/javascripts
but I dont see them being called anywhere, Rails its not compiling that , css works fine
Edit: Maybe they are beign called in a different order? how can I sort them?
Thanks!
Anyone knows why it's not bringing all the JS ? I see just pieces of it. How can I check that all the js is being compiled?
Is there any errors in your browser console?
Yes, its says: http://prntscr.com/spkzwj
Sounds like an issue with the Javascipt that you loaded in. Did you confirm else where that the Javascript works correctly in a rails application?
I cant confirm that works on rails, but I can confirm that works on local in a plain HTML5 I will try with a different landing page and let you know, thanks a lot
where can i add the images?
it works if I add this?
<%= image_tag ('/greenlight/app/assets/google-logo.png') %>
SOLVED:
HERE IS HOW:
<img src="<%= image_path 'google-logo.png' %>" alt="">
I want to make a change to my landing page , but i want to remove all of the current .html and change it to a different one. For that i need certain .js and .css for the carrousel
How can I add custom js / css to the front end? It can be done trough a CDN? where I edit the header, thanks!