Git Product home page Git Product logo

Comments (4)

remi avatar remi commented on May 27, 2024

Yeah, it doesn’t work because this "standard" Rails controller (my guess, based from the log output) expects params[:user] to contain the user data (eg. params[:user][:full_name]). In your backend, you currently seem to have something like this:

def create
  @user = User.create(params[:user])
end

I suggest you modify it with something like:

def create
  @user = User.create(user_params)
end

protected
def user_params
  params.slice(:full_name, :email, :foo, :bar)
end

This will make sure only allowed attributes are used and there won’t be a need to wrap the POST data in a user key.

Hope that helps!

from her.

natebird avatar natebird commented on May 27, 2024

Yep. That was the issue. Nice to see you supporting Strong Parameters already. :-)

from her.

remi avatar remi commented on May 27, 2024

Nice to see you supporting Strong Parameters already. :-)

Well, it doesn’t really have anything to with Her :)

from her.

simonc avatar simonc commented on May 27, 2024

I think there should be a way to add this option to Her because otherwise it prevents from interacting with an existing Rails app.

For instance, I'm playing with an app using ActiveAdmin, I'd like to not modify the controller behavior to handle Her calls.

I'll open a PR to add some kind of option to allow wrapping data, it should be pretty simple I think :)

from her.

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.