You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Rails 5+ controller parameters are an ActionController::Parameters object. This applies to all nested hashes and not only the top level key-value pairs (I think this last part is new to Rails 5 compared to 4). So if you want to pass some parameters into a cell, which happens to call url_for with these parameters, it fails because of the case block here:
does not handle ActionController::Parameters. A workaround is to call to_h on the parameter object, however it would be great if cells-rails handled it properly. Note that we can't add ActionController::Parameters next to Hash because it symbolize_keys has been deprecated in 5.0 and removed in a later version. It needs another when block which should call to_h.
A use case for the above is if you have a cell which needs to create URLs for sorting purposes (e.g. a table). In this case, you need to have the existing parameters in order to create the URLs for say, the links in the table header.
The text was updated successfully, but these errors were encountered:
In Rails 5+ controller parameters are an
ActionController::Parameters
object. This applies to all nested hashes and not only the top level key-value pairs (I think this last part is new to Rails 5 compared to 4). So if you want to pass some parameters into a cell, which happens to call url_for with these parameters, it fails because of thecase
block here:cells-rails/lib/cell/rails.rb
Lines 110 to 121 in 9f2c060
does not handle
ActionController::Parameters
. A workaround is to callto_h
on the parameter object, however it would be great if cells-rails handled it properly. Note that we can't addActionController::Parameters
next toHash
because itsymbolize_keys
has been deprecated in 5.0 and removed in a later version. It needs anotherwhen
block which should callto_h
.A use case for the above is if you have a cell which needs to create URLs for sorting purposes (e.g. a table). In this case, you need to have the existing parameters in order to create the URLs for say, the links in the table header.
The text was updated successfully, but these errors were encountered: