Forum: Ruby on Rails Question on RHTML and puts

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
668e7faa74d5e767e77d39518893c367?d=identicon&s=25 David Marko (Guest)
on 2006-04-07 22:41
In simple RHTML template a want to show values based on examples from
rails docs.
In first example 'puts "Frodo"' sends the value to console but not to
browser.

In second example I want avoid a huge of <%%> so I decided to put entire
cycle into one <%%> and print values to browser with 'puts'. Still the
same results.

Can someone clarify, why the value is not sent to browser as
documentation claims?

Exam.1
 Hi, Mr. <% puts "Frodo" %>

Exam. 2
  <% for person in @people %>
     puts 'Name:'+person.name+'<br />'
  <% end %>

I have Rails 1.1.1 on WinXP.

Thanks
David M.
668e7faa74d5e767e77d39518893c367?d=identicon&s=25 David Marko (Guest)
on 2006-04-07 22:43
Forget it. I just found in docs that its not the way...

David


David Marko wrote:
> In simple RHTML template a want to show values based on examples from
> rails docs.
> In first example 'puts "Frodo"' sends the value to console but not to
> browser.
>
> In second example I want avoid a huge of <%%> so I decided to put entire
> cycle into one <%%> and print values to browser with 'puts'. Still the
> same results.
>
> Can someone clarify, why the value is not sent to browser as
> documentation claims?
>
> Exam.1
>  Hi, Mr. <% puts "Frodo" %>
>
> Exam. 2
>   <% for person in @people %>
>      puts 'Name:'+person.name+'<br />'
>   <% end %>
>
> I have Rails 1.1.1 on WinXP.
>
> Thanks
> David M.
This topic is locked and can not be replied to.