Reputation:
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).
Upvotes: 2
Views: 2099
Reputation: 434685
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.
Upvotes: 2