I'm using Rails 4.1.8 and I want to get the HTML output, as a string, from a certain controller inside a Helper which I'll later use in a View.
Assuming app
were available at this point, this would be what I want. This, however, is just a conceptual example, not working code.
# pseudo-code
# widgets_helper.rb
module WidgetsHelper
def widget_html(widget_id)
app.get("/widgets/#{widget_id.to_s}.html")
app.response.body
end
end
I found this answer which appears to be related but I wasn't sure where to go with it.
I also read about render_to_string but I'm not sure if that's taking me to a workable solution either.
Update
That previous question has a comment that also mentions this question