Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An *.html.erb file is just an HTML file with some embedded ruby. Whenever you see a <%= some_code %>, that is ruby code to be executed and will show up on the page. Similarly, <% some_code %> is also ruby code, but will not show anything, just execute.

Here is a snippet from our the Indiana University production environment's app/views/modules/_header.html.erb, which you can see here: media.dlib.indiana.edu
The snippet sets up the featured items on the front page. 

...