Hi, I am reffering to "Agile Web Development with Rails 2nd ed B1 21.pdf" As per this book, <% 3.downto(1) do |count| -%> <%= count %>...<br /> <% end -%> Merry Christmas! The minus sign in end will supress the newline. This is not happening in my case. I am using ruby 1.8.4 and Rails 1.2.2 What could be the reason? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 13, 12:49 pm, "rita" <rita.sin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am reffering to "Agile Web Development with Rails 2nd ed B1 > 21.pdf" As per this book, > > <% 3.downto(1) do |count| -%> > <%= count %>...<br /> > <% end -%> > Merry Christmas! > > The minus sign in end will supress the newline. This is not > happening in my case.The generated HTML code should look like this: 3...<br /> 2...<br /> 1...<br /> Merry Christmas! If you leave out the minus sign, it should look like this: 3...<br /> 2...<br /> 1...<br /> Merry Christmas! Is that what you''re seeing, or are you getting something else? Note that the minus sign only suppresses the literal newline in the generated HTML code, not the <br /> tag which makes your browser display a newline when it renders the HTML. Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 13, 6:21 pm, "Chris Mear" <c...-OIzkuoyqg0kAvxtiuMwx3w@public.gmane.org> wrote:> On Mar 13, 12:49 pm, "rita" <rita.sin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > I am reffering to "Agile Web Development with Rails 2nd ed B1 > > 21.pdf" As per this book, > > > <% 3.downto(1) do |count| -%> > > <%= count %>...<br /> > > <% end -%> > > Merry Christmas! > > > The minus sign in end will supress the newline. This is not > > happening in my case. > > The generated HTML code should look like this: > > 3...<br /> > 2...<br /> > 1...<br /> > Merry Christmas! > > If you leave out the minus sign, it should look like this: > > 3...<br /> > 2...<br /> > 1...<br /> > > Merry Christmas! > > Is that what you''re seeing, or are you getting something else? Note > that the minus sign only suppresses the literal newline in the > generated HTML code, not the <br /> tag which makes your browser > display a newline when it renders the HTML. > > ChrisThough I will keep the minus sign or remove it I am getting the output as: 3...<br /> 2...<br /> 1...<br /> Merry Christmas! Rita. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rita wrote:> On Mar 13, 6:21 pm, "Chris Mear" <c...-OIzkuoyqg0kAvxtiuMwx3w@public.gmane.org> wrote: >> > Merry Christmas! >> >> generated HTML code, not the <br /> tag which makes your browser >> display a newline when it renders the HTML. >> >> Chris > > Though I will keep the minus sign or remove it I am getting the output > as: > > 3...<br /> > 2...<br /> > 1...<br /> > Merry Christmas! > > Rita.ok try this the -%> would remove the \n in the HTML tag, you shouldn''t worry about :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---