from the controller method, I am trying to grab the template rendering output from another controller.
view file is here:
path/to/show.html.erb
in my controller i:
def create
html_string = render_to_string :template => 'path/to/show'
raise 'html string is empty!' if html_string.empty?
end
The view file is very simple, just containing the text "foo".
I am not getting any error regarding the fact that the rails cannot find the show.html.erb file, but the html_string is empty and an error occurs.
I see this behavior when running the create method using the rspec controller test. I have not tried the code through the rails server yet.
Does anyone see something I'm missing here?
source
share