Comments (4)
Ok, you don't have to params[:return_to]
because params only has first_name
, last_name
and email
, isn't it?
Yes, then we have an API separating the whitelisted params and all params or no-whitelisted params.
API
params.raw[:whatever]
params.whitelisted[:other]
What do you think? I prefer whitelisted
than original
from controller.
I don't think we should have two API. params
should always represent the expected, (filtered if required) param list.
However, there should be a way to access the original, unfiltered list. If no param filtering is set, then params
and params.original
(or whatever name is) would be the same.
from controller.
Ok, I prefer too, this change doesn't break params api and it only adds the original
or raw
params. 👍
from controller.
API
Quoting @weppos
I don't think we should have two API. params should always represent the expected, (filtered if required) param list.
👍 This will keep the existing whitelisting semantic.
I'm for naming it #raw
.
Technical implementation
We can rename Params#_params
with Params#_raw
.
This method should memoize the result of that computation in @raw
. This should be a Lotus::Utils::Attributes
instance, in order to guarantee "indifferent access" until we drop support for 2.2-.
As last thing, we should expose an attr_reader :raw
.
from controller.
Related Issues (20)
- Flash #empty? returns true when it's not (after a re-direct) HOT 2
- Hanami::Action::Flash to use swappable JSON backend HOT 2
- Flash message appears twice (redux) HOT 3
- Exception Handling in Production HOT 19
- RuntimeError: can't add a new key into hash during iteration HOT 8
- Compatability issue with hanami-controller 2.0.0.alpha1 HOT 2
- Is `#request` supposed to be memoized for actions? HOT 2
- Standalone actions prevent using non-keyword parameters in `#initialize` (v2) HOT 3
- [2.0.0.alpha1] Uninitialized constant Hanami::Controller::Configuration (NameError) HOT 2
- Handling `config` and other class-level macros HOT 3
- accept syntax in README no longer seems supported HOT 1
- Action params are not coerced? HOT 5
- Badly encoded cookie strings from Safari results in an error HOT 3
- HTTP status 418 is missing HOT 1
- Issue with multipart/form-data format HOT 1
- Support CSRF by HTTP header HOT 4
- Support for hanami-validations/dry-validations `rule(...)`
- Documentation about Controller/Router integration is incorrect HOT 7
- Fix Response#send_file implementation
- handle_exception should allow exception names as strings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controller.