I have a helper file which includes a method which contains the following snippet:
header_id = Nokogiri::HTML.parse((render "shopfront/headers_#{@current_user.shop.header_id}"))
What I'm doing is getting the result of the partial contents (which contains some ERB), and then parsing it with Nokogiri for further use.
I'm trying to determine if there is a way to do this without using render
, as I would like to parse another view file in the same way, in the same method -- and at the moment it works perfectly (to parse the executed ERB in the view file), however I run into a double render issue.
Render and/or redirect were called multiple times in this action
Any tips as to how to achieve it without using a render, or making it possible to use a render twice in the same method without running into this issue (as I'm not actually rendering the view at all)?