Closed creasty closed 10 years ago
/foo
id
/foo?grid%5Bf%5D%5Bid%5D%5Beq%5D=1
/foo?grid=&grid%5Bf%5D%5Bid%5D%5Beq%5D=2
expected Hash (got String) for param 'grid'
https://github.com/leikind/wice_grid/blob/rails4/lib/wice/grid_renderer.rb#L467
base_link_with_pp_info = controller.url_for(new_params).gsub(/\?+$/,'')
I'm not sure this is a bug of Rails 4, but certainly url_for's behavior has been changed.
url_for
For instance, on Rails 3.2:
root_path(grid: {}) #=> /?
Whereas on 4:
root_path(grid: {}) #=> /?grid=
So if you simply append &grid[key]=value to ?grid=, and make ?grid=&grid[key]=value, Rails can't parse it into Hash.
&grid[key]=value
?grid=
?grid=&grid[key]=value
Thank you for merging. Now I close this issue.
Situation
/foo
id
attributes for "1" it shows/foo?grid%5Bf%5D%5Bid%5D%5Beq%5D=1
./foo?grid=&grid%5Bf%5D%5Bid%5D%5Beq%5D=2
.and causes the framework to raise an error:
expected Hash (got String) for param 'grid'
Cause
https://github.com/leikind/wice_grid/blob/rails4/lib/wice/grid_renderer.rb#L467
I'm not sure this is a bug of Rails 4, but certainly
url_for
's behavior has been changed.For instance, on Rails 3.2:
Whereas on 4:
So if you simply append
&grid[key]=value
to?grid=
, and make?grid=&grid[key]=value
, Rails can't parse it into Hash.