I’m building up an XML template to export to Excel.
I would like to do something like this:
<Worksheet ss:Name=<%= page.title %>>
to give the worksheet the name of the page title but this does not work.
If I do:
it all works.
How can I assign the page title to the worksheet name?
The problem is likely that you’re not wrapping
page.title in quotes, so Excel can’t properly parse the file. You should add them just outside the erb code:
<Worksheet ss:Name="<%= page.title %>">