I'm trying to remove square bracket from my string using gsub filter.
The string is something like this:
'["/path/to/1","/path/to/2"]'
I tried different ways to remove the square bracket "[" and "]" in order to get a string like '"/path/to/1","/path/to/2"'.
At first simply tried
gsub => [
"document_images", "[", "",
"document_images", "]", ""
]
Then I tried escaping the "[" with \ and \ but always get an exception at gsub filter.
I also tried
gsub => ["document_images", "[\[\]]", ""]
Again without success.
The same thing works using ruby gsub function:
'test['.gsub('[', '')
Any suggestions?