-
Notifications
You must be signed in to change notification settings - Fork 103
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
Hash + Model Example? #34
Comments
Hmm not totally clear on what you're looking for =\ Maybe an example of the API you're looking for? I know you tried to explain it, but it's not clicking with me right now The submit button isn't required or even added by default; in a FormController or FormableController subclass, just set the
|
Gotcha, I appreciate your help. I'll just simplify what I was looking for (the root of this) and hopefully you can see what I was I'm saying. Simply put, example FormModel data persists, and example KitchenSink data doesn't. If there was a property on KitchenSink, when flipped would make the data persist, I would have what I wanted. Does that help? FormModel, is a model automagically building a view. I'm looking for formotion's easlily buildable views (KitchenSink) to automagically build a model. Maybe I'm off in thinking that's the purpose of the methods of building provided. |
It appears I'm completely wrong. I could have SWORN that FormModel example maintained the data for you. I guess the app was still live in the background. My mistake, please disregard most of what I said. I still think it would be great if formotion was able to maintain state for you, but everything else above is just flat wrong. |
Ahh okay, didn't realize that's what you meant by persist. Yeah in the future that could be neat, especially for models. Pull requests are always welcome! |
Soon as I implement it in my current project, I'll def make an effort to add it with a pull request. Thanks for listening to my confusion :) |
Formotion is awesome.
It's great that a form can be initialized via hash or DSL, but it's somewhat unclear to me how to initialize with a hash that ties into a model without a submit button.
I've looked at the examples:
EXAMPLE FormModel
Uses the DSL to tightly couple the form data to the model
EXAMPLE KitchenSink
Uses the hash, but the data does not persist: Looks intended to be submitted to a webservice.
Of course what I"m looking for is to get the hash to tie in comfortable with the model (the mix of the 2). I don't want to break standard and use a "Submit" button. Since no settings page operates like that.
From what I can tell, you can initialize initWithForm XOR initWithModel. What I truly want is to initWithForm (so I can use the hash cleanliness) and then set a model. Maybe even a model per section!? if I want to be tidy.
I can't imagine I'm the only one with this requirement. Perhaps the formable should have the ability to set? Instead of just init?
I saw the formable code essentially observes change. I could write my own, but it seems that should be part of the formotion core right?
I feel like I've got a handle on the problem, but not so much on the solution. Is the solution just something I'm missing, or is it actually missing due to the incipient nature of the project?
The text was updated successfully, but these errors were encountered: