I currently have some code to render a partial, which includes:
:locals => {:feature => y}
This works fine, but I would like to be able to use a variable in place of :feature – I have tried the following:
:locals => {type.singularize => y}
but to no avail. What is the correct syntax to replace :feature with a local variable?
Incase anyone else comes across this, I was able to resolve it using the code in the comments from apneadiving and MurifoX: