Rendering rails partial with dynamic variables
问题 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: <%