LoginSignup
0
1

More than 5 years have passed since last update.

rails 画像表示

Last updated at Posted at 2017-11-14

slimの記述形式で画像の表示を行います

doctype html
html
head
meta charset="utf-8"
title HelloApp

= csrf_meta_tags

= stylesheet_link_tag 'application', media:'all', 'data-turbolinks-track': 'reload'
= javascript_include_tag 'application', 'data-turbolinks-track': 'reload'

body
/img src="assets/images/Item-0.png" width="30" height="30"
/img src="/assets/images/IMG_0709.jpg" width="30" height="30"
= image_tag '/Item-0.png'
= image_tag '/food.jpg'
p
| お試しruby on rails
br
| 2017 11 14作成
h3
a href="http://www.yahoo.co.jp" target="_blank" yahoo!
= yield

HelloApp.png

こんな感じ

※ slimのコメントは / で表示されます
※ imageの表示は = image_tag '/画像名' で行います(画像名の前に/を忘れずに。)
※ 画像はapp/public直下に配置して下さい
0
1
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
1