I want to output some text without using a template. Right now I have a controller action method that's altering the Content-Type of the response and I want to display the text directly, without creating a template file (a single-line template file is useless).
Asked
Active
Viewed 2,075 times
1 Answers
2
You can use render :text
in Rails 2.3:
You can send plain text – with no markup at all – back to the browser by using the
:text
option torender
[...]
So this:
render :text => 'whatever'
should do what you want.
The same thing works in Rails 3.

mu is too short
- 426,620
- 70
- 833
- 800
-
1@omouse: See "Rendering Text": http://apidock.com/rails/ActionController/Base/render – mu is too short Feb 16 '12 at 20:27