Model Validations?

37 views
Skip to first unread message

Anthony DeVito

unread,
Apr 25, 2013, 1:06:58 PM4/25/13
to plataformate...@googlegroups.com
Hello all, 
I am fairly new to simple form and I was wondering if it is possible to utilize the model validations with simple_form or do i need to make my own validations? If so how would I go about making my own validations or implementing the model validations on my form?

Vasiliy Ermolovich

unread,
Apr 25, 2013, 1:57:39 PM4/25/13
to plataformate...@googlegroups.com
Hey,

SimpleForm uses presence validation from your model:

"By default all inputs are required. When the form object has presence
validations attached to its fields, SimpleForm tells required and
optional fields apart. For performance reasons, this detection is
skipped on validations that make use of conditional options, such as
:if and :unless"

also SimpleForm uses such validation as length, numericality and
pattern. Just make sure that `config.browser_validations = true` in
your initializer if you want to use it since SimpleForm uses html5
attributes for this.
> --
> You received this message because you are subscribed to the Google Groups
> "SimpleForm" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to plataformatec-simp...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Anthonyd84

unread,
Apr 27, 2013, 12:05:46 AM4/27/13
to plataformate...@googlegroups.com, plataformate...@googlegroups.com
Thanks. I think the issue is due to a legacy gem set. 1.5.2

Im looking to see if the app can be upgraded if not i will do my own jquery validations.

Thanks for the response though. Much appreciated.

Regards,
Anthony DeVito
516 967 4963
> You received this message because you are subscribed to a topic in the Google Groups "SimpleForm" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/plataformatec-simpleform/h_uDIyL3iQk/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to plataformatec-simp...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages