img

img(src = "", alt = "", width = nil, height = nil)
Instance Public methods

Generate an Image element as a string.

src is the URL of the image. alt is the alternative text for the image. width is the width of the image, and height is its height.

Alternatively, the attributes can be specified as a hash.

img("src", "alt", 100, 50)
  # <IMG SRC="src" ALT="alt" WIDTH="100" HEIGHT="50">

img("SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50)
  # <IMG SRC="src" ALT="alt" WIDTH="100" HEIGHT="50">
doc_ruby_on_rails
2015-03-31 21:51:23
Comments
Leave a Comment

Please login to continue.