When creating the top page, I was stuck with the handling of images (super beginner)

As the title says. The OS is mac and I am studying ruby and rails, so I wrote it in .html.erb and .scss.

When I want to read an image file

erb:home.html.erb


<%= image_tag “Hogehoge Hogehoge.jpg” %>

If you write ↑, it will not be displayed in the browser! sprockets :: rails :: helper :: assetnotfound error


The solution

erb:home.html.erb


<%= image_tag “Hogehogehogehoge.jpg” %>

It was displayed by setting. In other words, I solved it by making all the names alphabetical.

When you want to use an image as the background

custom.scss


background-image: url(../images/hogehoge.jpg);

↑ is not displayed,


The solution

custom.scss


background-image: url(hogehoge.jpg);

It came to be displayed when.

I don't know the cause of either, but it's just a memo. ..

I started making it with my own hands for the first time, but it's more difficult than doing teaching materials. .. But it was fun. I will do my best at my own pace.

Recommended Posts

When creating the top page, I was stuck with the handling of images (super beginner)
I was stuck with the handling of the time zone when formatting with SimpleDateFormat
I checked because the response was strange when debugging with Tomcat 8
Problems I was addicted to when building the digdag environment with docker
[Rails] Button to return to the top of the page
I got stuck when port forwarding with VBox
I checked the number of taxis with Ruby
When I created a user my page, the user editing function of devise became strange.
The procedure I did when I prepared the environment of gradle + Java with VS Code (Windows 10)
I was entrusted with the design of the back end, so let's learn the endpoint design firmly
I was addicted to the record of the associated model
[Ruby] Misunderstanding that I was using the module [Beginner]
I investigated the super that I met with the devise controller
When I tried to scroll automatically with JScrollBar, the event handler was drawn only once.