2

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).

1 Answers1

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 to render [...]

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