Rails View External Resources

image_tag

<img> tag
Options alt, size, width, height etc…

audio_tag, video_tag

<% audio_tag 'test.wav', autoplay: false, controls: true %>

Favicon favicon_link_tag

<%= favicon_link_tag 'favicon.ico' %>
<%= favicon_link_tag 'favicon.png', type: 'imge/png' %>

path_to_xxxxx

  • path_to_javascript JavaScript path
  • path_to_stylesheet
  • path_to_audio
  • path_to_video
  • path_to_image
  • url_to_stylesheet Stylesheet url
<%= path_to_javascript('book.js') %>