1 Reply Latest reply on Jul 12, 2012 5:15 AM by Ariana Habbaba

    embedded Ruby syntax query

    DANIEL PARK

      Just a quick query:

       

      What is the difference between <% .......%>  and <%=........%> when embedding ruby in HTML

       

      cheers,

      Daniel

        • Re: embedded Ruby syntax query

          eRuby:

          <% ruby code %>  :    The Ruby code between the delimiters is replaced with its output

          <%= ruby expression %>  :     The Ruby expression between the delimiters is replaced with its value

          Using the <%= form acts as if you printed the value of the expression (for example the solution to a math equation).