gcorbel / activeform-rails Goto Github PK
View Code? Open in Web Editor NEWForm Objects for ActiveModel
License: MIT License
Form Objects for ActiveModel
License: MIT License
Hello,
Sorry for the newbie issue, but I have problems validating an object I create using activeform-rails.
I created a new class, and included ActiveForm::Form and ActiveForm::ValidateUniqueness. When I attempt to validate a valid object (valid?), it works fine. When I attempt to validate an invalid object, I get "NameError: uninitialized constant ActiveForm::Form::ClassMethods::UnpersistentModel".
If I put in my class "include ActiveForm::UnpersistentModel" I get "NameError: uninitialized constant ActiveForm::UnpersistentModel".
If I put in my .rb file (or on my irb console) the actual code from the unpersistent_model.rb file, everything works fine.
I am sure I am doing something simple incorrectly, perhaps mixing ActiveForm::UnpersistentModel into my class incorrectly.
Your help appreciated.
Any plans to update (if any such updates are even needed) for Rails 4?
@GCorbel, I was pretty excited when I saw your form object the other day, so integrated at the earliest opportunity. Thanks for contributing it to the community. However, as you can see, I've hit a number of issues using it and have done what I can to help by submitting my two pull requests #2 and #1.
I have now gone home and started wondering if I made the right choice changing from our home grown object models to this gem simply because it's turned out to be a lot more work than I thought. I then did a bit of searching too and came across https://github.com/apotonick/reform.
I'd like to know specifically what you were aiming to achieve with this Gem as opposed to simply using https://github.com/apotonick/reform? I am happy to help contribute, but equally if there is a gem out there that already does the job well, I'd like to know why we shouldn't just use that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.