I'm just getting started with Ruby and Ruby on Rails, so excuse me if this is a simple question. I've noticed that in some ERB files, there is a difference to using <%= %>
and <% %>
, but what is the difference?
Thanks!
I'm just getting started with Ruby and Ruby on Rails, so excuse me if this is a simple question. I've noticed that in some ERB files, there is a difference to using <%= %>
and <% %>
, but what is the difference?
Thanks!
Hi, The difference is as follows:- <%= %> would execute and print the value of rails code written inside and <% %> would just execute the rails code.
Thanks, Anubhaw