Forum: Ruby on Rails probably a very dumb question

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.
Guest (Guest)
on 2005-12-26 12:30
why does <%= render_text "hey ya" %>

cause 'undefined method `render_text' for
#<#<Class:0x3851120>:0x3851000>'

can i use render text in a template?
Gerard (Guest)
on 2005-12-26 12:47
(Received via mailing list)
Pete,

It has a changed syntax (see: http://api.rubyonrails.org/)

Rendering of text is usually used for tests or for rendering prepared
content,
such as a cache. By default, text rendering is not done within the
active
layout.

  # Renders the clear text "hello world" with status code 200
  render :text => "hello world!"

Deprecation notice: This used to have the signature render_text("text",
status
= 200)

On Monday 26 December 2005 11:30, removed_email_address@domain.invalid tried to 
type
something
like:
> why does <%= render_text "hey ya" %>
>
> cause 'undefined method `render_text' for
> #<#<Class:0x3851120>:0x3851000>'
>
> can i use render text in a template?

--
"Who cares if it doesn't do anything?  It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..."

My $Grtz =~ Gerard;
~
:wq!
Justin F. (Guest)
on 2005-12-26 13:15
(Received via mailing list)
removed_email_address@domain.invalid wrote:
> why does <%= render_text "hey ya" %>
>
> cause 'undefined method `render_text' for
> #<#<Class:0x3851120>:0x3851000>'
>
> can i use render text in a template?

There's no need to - all you need here is

<%= "hey ya" %>

(assuming that "hey ya" is a placeholder for something more dynamic - if
it was just static text it should be part of the template itself).

The render method is a controller method.

regards

   Justin
This topic is locked and can not be replied to.