Use custom css (Rails and windows)

Asked

Viewed 222 times

1

Good afternoon,

I’m a beginner in Rails and I’m trying to put in the project the frontend I have here from another site. HTML, css and javascript are all ready. Then I managed a controller with the Public name with all the views (frontend menus, home, contact, etc). I then took the css and put it inside Assets/stylesheets. Then I took the js files and put them in the Assets/Javascripts folder. I then made a new layout, public.html.erb. In it, I try to call the custom css and I can’t. I’ve tried editing the manifest by putting its name and nothing has changed. When I call there in the view using:

<%= stylesheet_link_tag  'app', media: 'all' %>

or

<%= stylesheet_link_tag  'application', media: 'all' %>

I always get the message: Execjs::Programerror in Public#nomedaminhaview

app.css is the name of my css. How I use a proper css in a Windows Rails app?

1 answer

0

In your 'Assets/stylesheets/application.css' you should have

 *= require_tree .
 *= require_self

And in your 'views/layout/application.html.erb'

<%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>

This already imports all the 'css' files present in the 'stylesheets' folder'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.