Guest User

Untitled

a guest
May 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Consider this:
  2.  
  3. `= select_tag "blockstyles[#{blockstyle}]"`
  4.  
  5. Now consider
  6.  
  7. `blockstyle == "[Basic Text Frame]"`
  8.  
  9. resulting in http parameter name
  10.  
  11. `blockstyles[[Basic Text Frame]]`
  12.  
  13. which results in Rails turning that into
  14.  
  15. `"blockstyles"=>{"Basic Text Frame"=>""}`
  16.  
  17. 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.
  18.  
  19. Is there a way to escape the square brackets in the string so I get
  20.  
  21. `"blockstyles"=>{"[Basic Text Frame]"=>""}`
  22.  
  23. Oh, and if you're wondering why the square brackets have to be there, I can genuinely blame adobe for this.
Add Comment
Please, Sign In to add comment