Coder Social home page Coder Social logo

Hash + Model Example? about formotion HOT 5 CLOSED

clayallsopp avatar clayallsopp commented on September 13, 2024
Hash + Model Example?

from formotion.

Comments (5)

clayallsopp avatar clayallsopp commented on September 13, 2024

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 submit callback and add a place where that's triggered:

def viewDidLoad
    super

    self.form.on_submit do
       self.submit
    end

    # Custom UI for submitting a form
    self.navigationItem.rightBarButtonItem = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemSave, target:self, action:'submit')
  end

  def submit
    data = self.form.render

    # do something with data
  end

from formotion.

GantMan avatar GantMan commented on September 13, 2024

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.

from formotion.

GantMan avatar GantMan commented on September 13, 2024

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.

from formotion.

clayallsopp avatar clayallsopp commented on September 13, 2024

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!

from formotion.

GantMan avatar GantMan commented on September 13, 2024

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 :)

from formotion.

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.