I have a helper called FeaturesHelper that has data about some features:
feature_info = [
{features:
[
{
description: "This is a #{view_context.link_to "link!", "https://www.example.com", target: :_blank, class: "pink-link"}",
}
]
}, ...]
I then have a partial that uses feature_info:
<% feature_info.each do |info|%>
<% info[:features].each do |feature| %>
<%= feature[:description].html_safe %>
<% end %>
<% end %>
I then render the partial in a view:
<%= render partial: "partial_name" %>
This leads to an error with the stack trace pointing no my FeaturesHelper:
undefined local variable or method `view_context' for #ActionView::Base:0x007f80a6cdcf20
view_context is not visible there, you'll need to pass it as a parameter.
on your view: