Giter Site home page Giter Site logo

Comments (4)

AlfonsoUceda avatar AlfonsoUceda commented on May 17, 2024

Ok, you don't have to params[:return_to] because params only has first_name, last_nameand 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.

weppos avatar weppos commented on May 17, 2024

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.

AlfonsoUceda avatar AlfonsoUceda commented on May 17, 2024

Ok, I prefer too, this change doesn't break params api and it only adds the original or raw params. 👍

from controller.

jodosha avatar jodosha commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.