Closed nashbridges closed 8 years ago
Were you using a strong parameters strategy with the previous implementation?
No, the default one – ActiveRecordWithEagerAttributesStrategy, which handled new records correctly
Since decent_exposure is looking for a [exposure_name]_params
method, which users tend to utilize with strong parameters, we've blocked GET
requests from taking params. By utilizing the custom build_params
method you've bypassed that check... making it work for you.
We looked into making this work the way you'd like but have decided it may cause more pain for most other users with [exposure_name]_params
methods already defined. So I think that the build_params
override would be the best way to handle your particular usage case.
OK, now I see. Looks this is another candidate for https://github.com/hashrocket/decent_exposure/wiki/Api-changes-in-version-3
Thanks for understanding and using decent_exposure!
This is another regression (feature?) from v2.
Previously I can prefill edit form by passing params in an URL as such:
In v3 default
:build_params
are empty for GET request, so it no longer works.Sure, I can fix it by providing
build_params: ->{ invoice_params }
, but I don't quite understand the reason for this logic.