Last active
January 5, 2023 22:26
-
-
Save DevGW/1179519a69b16832025e79d4013918c0 to your computer and use it in GitHub Desktop.
Ruby / Rails :: Simple Array #RoR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This goes in controller for page: | |
def gallery | |
@images = ["1", "2"] | |
end | |
# This goes in code of the page itself | |
<% @images.each do |image| %> | |
<a class="example-image-link" href="/assets/<%= image %>.png" data-lightbox="example-set" data-title="'Baby' by Isleifr - 8x10 Stretched Canvas giclee print. Original: Waterbased Oil on Stretched Canvas"><img class="example-image" src="/assets/<%= image %>thumb.png" alt=""/></a> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment