Created
April 12, 2010 17:11
-
-
Save james/363781 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Consider this: | |
`= select_tag "blockstyles[#{blockstyle}]"` | |
Now consider | |
`blockstyle == "[Basic Text Frame]"` | |
resulting in http parameter name | |
`blockstyles[[Basic Text Frame]]` | |
which results in Rails turning that into | |
`"blockstyles"=>{"Basic Text Frame"=>""}` | |
As it thinks it's 'helpfully' interpreting the extra square brackets as a double hash opening, which of course I don't want, so discards. | |
Is there a way to escape the square brackets in the string so I get | |
`"blockstyles"=>{"[Basic Text Frame]"=>""}` | |
Oh, and if you're wondering why the square brackets have to be there, I can genuinely blame adobe for this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment