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.
B3576d7ce54751aa0f6b646af31492f7?d=identicon&s=25 Guest (Guest)
on 2005-12-26 11:30
why does <%= render_text "hey ya" %>

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

can i use render text in a template?
4710a8ada2adc162aaee4288d9879d8e?d=identicon&s=25 Gerard (Guest)
on 2005-12-26 11: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, peteehill@gmail.com 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!
Eea7ad39737b0dbf3de38874e0a6c7d8?d=identicon&s=25 Justin Forder (Guest)
on 2005-12-26 12:15
(Received via mailing list)
peteehill@gmail.com 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.