-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Rails like Strong Parameter support #25
Comments
Middleware wouldn't work, because middleware is currently between the Alternatively we could figure out a good pattern for modules that intercept requests (post router, pre-controller, or upon controller initialization). I played around with some ideas during dev but didn't settle on anything concrete. |
Yeah, I noticed middleware is used during render(), any reasons in particular for why you would have it so deep in the chain? If you take a look at Rails, you'll see the middleware called far sooner and obviously before they even hit controllers. This allows you to move a lot more code to the middleware and thus allowing people to tweak what they want or don't want. I do like the idea of being opinionated out of the box, but let people tweak what they want to get rid off. Don't want cookies? Fine get rid of it.
Wish you didn't close the other issue related to it, as I would love to push for changing the middleware execution. |
By closing it I didn't mean I wanted to forget about it :). Let's talk about it here. I'm totally open to changing Middleware execution, we'll need to rename the current iteration of Middleware as "post-middleware" or something, for modifying data being sent to the client. Endware? Finalizers? I'm not sure. |
From the looks of it, you want a middleware stack for responses and one for requests. |
How about make router.js and controller.js into middleware and you could insert something like Wouldn't be too much change but I've just briefly looked through the code. Just a thought. |
So what are folks thoughts on enforcement at the controller (ala rails permit) vs model level. |
@intabulas Permit levels might be different between endpoints on controllers. There is some history to why rails moved it out of models and into per controller specifics. |
exactly, which is why it should not be in the model IMHO. I had a much longer initial comment I killed since I though it would be worthwhile to start discussion |
I think moving the entire stack into middle-wares is a better move to begin with before adding things like strong-params. Unfortunately that issue got closed down and I am not sure where that stands. There is no "middleware" as of now, as it only executed before render() is called, which makes it kinda pointless. |
well I think @keithwhor closed it so it could be discussed in this issue, so lets discuss it :) |
So StrongParams, ie: except(), permit() is done in the 0.7 branch.. See https://github.com/intabulas/nodal/commit/536ca14d21be0a896804c5fddbddc3a3d5351ae8 @keithwhor we can close |
I could finish an implementation of Strong Parameter support as a middleware, but not sure if that would be accepted?
The text was updated successfully, but these errors were encountered: