Rails 문자열, 숫자 관련 뷰 헬퍼4
image_tag(src)
메소드
<%= image_tag 'test1.gif' %>
혹은
<%= image_tag 'https://www.test.com/image/link1.png' %>
대부분의 레일즈 뷰헬퍼가 그렇듯이 아래처럼 옵션을 주는 것도 가능 하다.
<%= image_tag 'https://www.test.com/image/link1.png', size: '190x100' %>
audio_tag(src)
메소드 (HTML5)
<%= audio_tag 'test1.wav' %>
오디오 재생 관련 옵션을 넣는다면
<%= audio_tag 'test1.wav', autoplay: false, controls: true %>
video_tag
메소드 (HTML5)
<%= video_tag 'test1.mp4' %>
비디오 재생 관련 옵션을 넣는다면
<%= video_tag 'test1.mp4', controls: true, autoplay: false, loop: true, size: '300x150', poster: 'logo.png' %>
auto_discovery_link_tag
메소드
<%= auto_discovery_link_tag(:rss, { controller: :posts, actions: :index }) %>
favicon_link_tag
메소드
<%= favicon_link_tag 'favicon.ico', type: 'image/png' %>
path_to_javascript
메소드
<%= path_to_javascript 'test.js' %>
path_to_stylesheet
메소드
<%= path_to_stylesheet 'test.css' %>
path_to_audio
메소드
<%= path_to_audio 'test.mp3' %>
path_to_video
메소드
<%= path_to_video 'test.mp4' %>
path_to_image
메소드
<%= path_to_image 'test.png' %>