image_tag

    0

    0

    YITING OU

    The code in the brackets uses the image_tag() function to create an HTML tag that will include a link to an image hosted on Unsplash.com. The class attribute specifies that the tag should be treated as an absolute inset-0 h-full w-full object-cover element, which will ensure that the image covers the whole area of the document, and the tag attribute specifies that the tag should not have any content.

    <%= image_tag "https://images.unsplash.com/photo-1505904267569-f02eaeb45a4c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1908&q=80",
              { class: "absolute inset-0 h-full w-full object-cover",
              tag: ""
              }
      %>
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.