0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Railsにfaviconを設定する方法

Last updated at Posted at 2023-06-05

概要

以下参考記事を元にメモ程度にRailsのfaviconの設定方法をまとめたいと思います。

手順

1.assets/assets/images配下にfavicon.icoファイルを設置

assets/assets/images/favicon.ico

2.application.html.erbのheadタグに以下タグを挿入

<%= favicon_link_tag('favicon.ico') %>
app/views/layouts/application.html.erb
<html>
  <head>
<!--(省略) -->
<!-- ここから -->

    <%= favicon_link_tag('favicon.ico') %>

<!-- ここまで -->
<!--(省略) -->
  </head>
  <body>
    <header>
    </header>
    <%= yield %>
  </body>
</html>

以上で導入完了です。

参考

favicon設定 Rails

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?