Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Pass context for the entire field, not each method individually #17

Open
leemeichin opened this issue Apr 14, 2016 · 2 comments
Open

Pass context for the entire field, not each method individually #17

leemeichin opened this issue Apr 14, 2016 · 2 comments

Comments

@leemeichin
Copy link
Owner

The current way of doing it is really restrictive, especially for multiple choices. Change it so context is passed at the field level, like this:

field :multiple_choice do |users|
    ask "Hello, who do you want to find?"

    users.each do |user|
      choice user.name
    end
end

Which removes the complexity of having to detect lambdas all over the place.

@fhinson
Copy link

fhinson commented Apr 14, 2016

@leemachin This functionality would be extremely helpful for a project I'm working on. Any idea how long this will take to implement?

@leemeichin
Copy link
Owner Author

Honestly I'm not sure. I need to figure out the right way to do it and I think it might mean changing how some things work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants