With Microsnot technology you an do this: <% Response.Write "Hello, World" %> How do you output text to the browser with Ruby? Pete -- 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 -~----------~----~----~----~------~----~------~--~---
On 8 Nov 2008, at 19:57, Peter Alvin <rails-mailing-list@andreas- s.net> wrote:> > With Microsnot technology you an do this: > > <% Response.Write "Hello, World" %> ><%= "hello world" %> Fred> How do you output text to the browser with Ruby? > > Pete > -- > 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 -~----------~----~----~----~------~----~------~--~---
Thanks Fred, that''s perfect. Pete -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 8 Nov 2008, at 19:57, Peter Alvin <rails-mailing-list@andreas- > > > s.net> wrote: >> With Microsnot technology you an do this: >> >> <% Response.Write "Hello, World" %> >> >> > <%= "hello world" %> > > Fred > >> How do you output text to the browser with Ruby? >> >> Pete >> -- >> Posted via http://www.ruby-forum.com/. >> >>Fred.. Maybe I am missing something here but why would you surround a straight string in <%=""%>. Why not just put hello world? Norm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
the <%= %> notation is what you use in a view to execute embedded ruby code. if you literally want to just print "hello world" in your view, then you wouldn''t need the <%= %>. however, say you want to say "hello username" where username is the current user''s name, then your view would look something like: hello <%= currentuser.name %> On Nov 9, 12:24 pm, Norm <normsche...-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org> wrote:> Frederick Cheung wrote: > > On 8 Nov 2008, at 19:57, Peter Alvin <rails-mailing-list@andreas- > > > s.net> wrote: > >> With Microsnot technology you an do this: > > >> <% Response.Write "Hello, World" %> > > > <%= "hello world" %> > > > Fred > > >> How do you output text to the browser with Ruby? > > >> Pete > >> -- > >> Posted viahttp://www.ruby-forum.com/. > > Fred.. > Maybe I am missing something here but why would you surround a straight > string in <%=""%>. Why not just put hello world? > > Norm--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
one quick note... <%= %> is what you use to executed embedded ruby code and then display the output in your view. <% %> (no equals sign) is what you use to just execute ruby code without displaying the output in your view. so you could do something like: <% 3.times do %> Hello <%= currentuser.name %> <% end %> On Nov 9, 12:34 pm, gaveeno <gavin.to...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the <%= %> notation is what you use in a view to execute embedded > ruby code. if you literally want to just print "hello world" in your > view, then you wouldn''t need the <%= %>. however, say you want to > say "hello username" where username is the current user''s name, then > your view would look something like: > > hello <%= currentuser.name %> > > On Nov 9, 12:24 pm, Norm <normsche...-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org> wrote: > > > Frederick Cheung wrote: > > > On 8 Nov 2008, at 19:57, Peter Alvin <rails-mailing-list@andreas- > > > > s.net> wrote: > > >> With Microsnot technology you an do this: > > > >> <% Response.Write "Hello, World" %> > > > > <%= "hello world" %> > > > > Fred > > > >> How do you output text to the browser with Ruby? > > > >> Pete > > >> -- > > >> Posted viahttp://www.ruby-forum.com/. > > > Fred.. > > Maybe I am missing something here but why would you surround a straight > > string in <%=""%>. Why not just put hello world? > > > Norm--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 9 Nov 2008, at 17:24, Norm wrote:> Frederick Cheung wrote: >> On 8 Nov 2008, at 19:57, Peter Alvin <rails-mailing-list@andreas- >> >> >> s.net> wrote: >>> With Microsnot technology you an do this: >>> >>> <% Response.Write "Hello, World" %> >>> >>> >> <%= "hello world" %> >> >> Fred >> >>> How do you output text to the browser with Ruby? >>> >>> Pete >>> -- >>> Posted via http://www.ruby-forum.com/. >>> >>> > Fred.. > Maybe I am missing something here but why would you surround a > straight string in <%=""%>. Why not just put hello world? >You wouldn''t normally, just as you wouldn''t actually put <% Response.Write "Hello, World" %> either. It was an example. Fred> Norm > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---