Chavelle Vincent
2012-Jan-17 18:06 UTC
What is the best way to validate a json object? (POST request)
I must create a class (JobClass) and include ActiveModel::Validations? and then valided = JobClass.new(params).valid? The JSON body : http://pastebin.com/TwRbydmq I can not create rules corresponding to the validation of the field "method" ... It can be "concat" or "split" but it is not the first level. How can I do? Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Apparently Analagous Threads
- Best way to send JSON request/get a response from controller?
- [PATCH] add :root option to ActiveModel JSON serialization
- ActiveModel::Serializers::JSON support arbitrary keys
- "best practices" for Rails serving RESTful JSON services for use by AngularJS, Ember.js, etc.
- ActiveRecord::Validator vs ActiveModel::Validator