I'm trying to render a partial based on the taxon the user is inside. In my application.html.erb layout I have the following line of code:
<%= render 'spree/shared/women_subnav' if @enable_women %>
In the taxons controller, inside the show method, I have:
@taxon_id = params[:id].split('/').first
And in taxons#show I have:
<% if @taxon_id == params[:id].split('/').first %>
<%= "@enable_#{@taxon_id}" = true %>
<% end %>
When I run this I get a SyntaxError. But in taxons#show If I just enter:
<% if @taxon_id == params[:id].split('/').first %>
<%= "@enable_#{@taxon_id}" %>
<% end %>
without the '= true' then the page renders, outputting '@enable_women'. So I know it's getting the correct variable, I just need that variable to be set to true. What am I missing?
Thanks so much.