Try this in a view running rails 2.2.3 with ruby 1.8.7. I tried in 1.8.6 and worked just as expected. But in 1.8.7 it doesn''t execute the code inside a condition that has a comment. Sample: <% if (@var)%> @var is nil so it wont get in here <% else # a comment %> it must to get in here, but it doesnt unless the comment in the above condition is removed. <% end %>
Frederick Cheung
2009-Aug-18 18:18 UTC
Re: Possible BUG on rails 2.2.3 with ruby 1.8.7 patchlevel 174
On Aug 18, 4:07 pm, Xinobit <xino...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try this in a view running rails 2.2.3 with ruby 1.8.7. I tried in > 1.8.6 and worked just as expected. But in 1.8.7 it doesn''t execute the > code inside a condition that has a comment. Sample: >This is a ruby 1.8.7 change. Apparently comments like that were never allowed in the first place (http://www.ruby-forum.com/topic/154835 ) Fred> <% if (@var)%> > @var is nil so it wont get in here > <% else # a comment %> > it must to get in here, but it doesnt unless the comment in the above > condition is removed. > <% end %>