I have a Rails 5 app. Inside my FooController
, I am generating some html content via:
ApplicationController.new.render_to_string("some_haml_file", locals: {foo: "bar"}, layout: false)
Inside some_haml_file.html.haml
I need to perform some complicated logic, so leveraging helper methods, or something that corresponds to it, would help a lot. A .rb
file of some kind to include.
Is it possible? I suspect that the question may have been answered in this SO post, but I honestly don't understand it.