I'm attempting to use render html: to render raw html from a controller action:
class SomeController < ApplicationController
def raw_html
render html: '<html><body>Some body text</body></html>'
end
end
However, when I run this controller action, I get a "Template is missing" error
I don't want to use a template, just render raw html.
The error I get is:
Processing by SomeController#raw_html as HTML
Parameters: {}
ActionView::MissingTemplate (Missing template some_controller/raw_html
with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder,
:raw, :ruby]}. Searched in: *
"/Users/doved/source/sample_app/app/views" *
"/Users/doved/.rvm/gems/ruby-2.0.0-p353@syp/gems/chameleon-0.2.4/app/views"
* "/Users/doved/.rvm/gems/ruby-2.0.0-p353@syp/gems/kaminari-0.15.1/app/views"):
app/controllers/some_controller.rb:14:in raw_html'call'
lib/middleware/cors_middleware.rb:8:in
I'm using Rails 4.0.2
What am I doing wrong?