Soumettre la recherche
Mettre en ligne
Validações no Ruby on Rails
•
1 j'aime
•
15,518 vues
Eduardo Mendes
Suivre
Breve apresentação sobre algumas validações do Rails no Model
Lire moins
Lire la suite
Technologie
Signaler
Partager
Signaler
Partager
1 sur 10
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Element Styles and Positioning
Element Styles and Positioning
alexisabril
用jQuery玩弄你的網頁1
用jQuery玩弄你的網頁1
Mu Chun Wang
Hello, Canvas.
Hello, Canvas.
Seth McLaughlin
Javascipt ch1
Javascipt ch1
Brady Cheng
A SOLID Design in InterSystems ObjectScript
A SOLID Design in InterSystems ObjectScript
AnastasiaDyubaylo
DevNexus 2016
DevNexus 2016
Stephanie Brubaker
Css responsive
Css responsive
AbhishekMondal42
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
katbailey
Recommandé
Element Styles and Positioning
Element Styles and Positioning
alexisabril
用jQuery玩弄你的網頁1
用jQuery玩弄你的網頁1
Mu Chun Wang
Hello, Canvas.
Hello, Canvas.
Seth McLaughlin
Javascipt ch1
Javascipt ch1
Brady Cheng
A SOLID Design in InterSystems ObjectScript
A SOLID Design in InterSystems ObjectScript
AnastasiaDyubaylo
DevNexus 2016
DevNexus 2016
Stephanie Brubaker
Css responsive
Css responsive
AbhishekMondal42
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
katbailey
Plone Interactivity
Plone Interactivity
Eric Steele
devise tutorial - 2011 rubyconf taiwan
devise tutorial - 2011 rubyconf taiwan
Tse-Ching Ho
Tame Accidental Complexity with Ruby and MongoMapper
Tame Accidental Complexity with Ruby and MongoMapper
Giordano Scalzo
Simple blog wall creation on Java
Simple blog wall creation on Java
Max Titov
Node.js 與 google cloud storage
Node.js 與 google cloud storage
onlinemad
Building sustainable RESTFul services
Building sustainable RESTFul services
Ortus Solutions, Corp
The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!
Donny Wals
Testing swagger contracts without contract based testing
Testing swagger contracts without contract based testing
Алексей Стягайло
Webauthn Tutorial
Webauthn Tutorial
FIDO Alliance
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
pauldix
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
pauldix
Barcamp Auckland Rails3 presentation
Barcamp Auckland Rails3 presentation
Sociable
Seguranca em APP Rails
Seguranca em APP Rails
Daniel Lopes
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
Rob Tweed
Api's and ember js
Api's and ember js
Edwin Cruz
Active Record Form Helpers, Season 1
Active Record Form Helpers, Season 1
RORLAB
Deploying your static web app to the Cloud
Deploying your static web app to the Cloud
Christoffer Noring
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014
Rob Gietema
How to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAM
Provectus
Rails3 changesets
Rails3 changesets
Wen-Tien Chang
JavaScript - Introdução com Orientação a Objetos
JavaScript - Introdução com Orientação a Objetos
Eduardo Mendes
AngularJS - Rotas
AngularJS - Rotas
Eduardo Mendes
Contenu connexe
Similaire à Validações no Ruby on Rails
Plone Interactivity
Plone Interactivity
Eric Steele
devise tutorial - 2011 rubyconf taiwan
devise tutorial - 2011 rubyconf taiwan
Tse-Ching Ho
Tame Accidental Complexity with Ruby and MongoMapper
Tame Accidental Complexity with Ruby and MongoMapper
Giordano Scalzo
Simple blog wall creation on Java
Simple blog wall creation on Java
Max Titov
Node.js 與 google cloud storage
Node.js 與 google cloud storage
onlinemad
Building sustainable RESTFul services
Building sustainable RESTFul services
Ortus Solutions, Corp
The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!
Donny Wals
Testing swagger contracts without contract based testing
Testing swagger contracts without contract based testing
Алексей Стягайло
Webauthn Tutorial
Webauthn Tutorial
FIDO Alliance
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
pauldix
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
pauldix
Barcamp Auckland Rails3 presentation
Barcamp Auckland Rails3 presentation
Sociable
Seguranca em APP Rails
Seguranca em APP Rails
Daniel Lopes
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
Rob Tweed
Api's and ember js
Api's and ember js
Edwin Cruz
Active Record Form Helpers, Season 1
Active Record Form Helpers, Season 1
RORLAB
Deploying your static web app to the Cloud
Deploying your static web app to the Cloud
Christoffer Noring
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014
Rob Gietema
How to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAM
Provectus
Rails3 changesets
Rails3 changesets
Wen-Tien Chang
Similaire à Validações no Ruby on Rails
(20)
Plone Interactivity
Plone Interactivity
devise tutorial - 2011 rubyconf taiwan
devise tutorial - 2011 rubyconf taiwan
Tame Accidental Complexity with Ruby and MongoMapper
Tame Accidental Complexity with Ruby and MongoMapper
Simple blog wall creation on Java
Simple blog wall creation on Java
Node.js 與 google cloud storage
Node.js 與 google cloud storage
Building sustainable RESTFul services
Building sustainable RESTFul services
The Testing Games: Mocking, yay!
The Testing Games: Mocking, yay!
Testing swagger contracts without contract based testing
Testing swagger contracts without contract based testing
Webauthn Tutorial
Webauthn Tutorial
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
Barcamp Auckland Rails3 presentation
Barcamp Auckland Rails3 presentation
Seguranca em APP Rails
Seguranca em APP Rails
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
Api's and ember js
Api's and ember js
Active Record Form Helpers, Season 1
Active Record Form Helpers, Season 1
Deploying your static web app to the Cloud
Deploying your static web app to the Cloud
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014
How to implement authorization in your backend with AWS IAM
How to implement authorization in your backend with AWS IAM
Rails3 changesets
Rails3 changesets
Plus de Eduardo Mendes
JavaScript - Introdução com Orientação a Objetos
JavaScript - Introdução com Orientação a Objetos
Eduardo Mendes
AngularJS - Rotas
AngularJS - Rotas
Eduardo Mendes
Angular JS - Fundamentos
Angular JS - Fundamentos
Eduardo Mendes
Singleton - Padrão de Projeto
Singleton - Padrão de Projeto
Eduardo Mendes
Layout Fluido
Layout Fluido
Eduardo Mendes
Web Design Responsivo
Web Design Responsivo
Eduardo Mendes
Html - Aula 4
Html - Aula 4
Eduardo Mendes
Html - Aula 3
Html - Aula 3
Eduardo Mendes
Introdução à Internet, Http e HTML
Introdução à Internet, Http e HTML
Eduardo Mendes
ExtJS-4
ExtJS-4
Eduardo Mendes
Jquery 2
Jquery 2
Eduardo Mendes
Jquery
Jquery
Eduardo Mendes
Estimativas de Esforço - Engenharia de Software
Estimativas de Esforço - Engenharia de Software
Eduardo Mendes
Java web 6 JSP Expression Language Taglib parte 2
Java web 6 JSP Expression Language Taglib parte 2
Eduardo Mendes
Padrão Iterator
Padrão Iterator
Eduardo Mendes
Padroes Template-Method (Método Gabarito)
Padroes Template-Method (Método Gabarito)
Eduardo Mendes
Padrão Command
Padrão Command
Eduardo Mendes
Padrão Fachada
Padrão Fachada
Eduardo Mendes
Padrão Adapter
Padrão Adapter
Eduardo Mendes
Web Design Responsivo
Web Design Responsivo
Eduardo Mendes
Plus de Eduardo Mendes
(20)
JavaScript - Introdução com Orientação a Objetos
JavaScript - Introdução com Orientação a Objetos
AngularJS - Rotas
AngularJS - Rotas
Angular JS - Fundamentos
Angular JS - Fundamentos
Singleton - Padrão de Projeto
Singleton - Padrão de Projeto
Layout Fluido
Layout Fluido
Web Design Responsivo
Web Design Responsivo
Html - Aula 4
Html - Aula 4
Html - Aula 3
Html - Aula 3
Introdução à Internet, Http e HTML
Introdução à Internet, Http e HTML
ExtJS-4
ExtJS-4
Jquery 2
Jquery 2
Jquery
Jquery
Estimativas de Esforço - Engenharia de Software
Estimativas de Esforço - Engenharia de Software
Java web 6 JSP Expression Language Taglib parte 2
Java web 6 JSP Expression Language Taglib parte 2
Padrão Iterator
Padrão Iterator
Padroes Template-Method (Método Gabarito)
Padroes Template-Method (Método Gabarito)
Padrão Command
Padrão Command
Padrão Fachada
Padrão Fachada
Padrão Adapter
Padrão Adapter
Web Design Responsivo
Web Design Responsivo
Dernier
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
The Digital Insurer
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Overkill Security
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
apidays
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
MIND CTI
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
sammart93
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
rafiqahmad00786416
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Remote DBA Services
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Zilliz
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Edi Saputra
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
DianaGray10
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Orbitshub
Architecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
apidays
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Zilliz
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
Dernier
(20)
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Architecting Cloud Native Applications
Architecting Cloud Native Applications
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Validações no Ruby on Rails
1.
Validações! http://edgeguides.rubyonrails.org/ active_record_validations.html
2.
Validações Rails • Configurações no
modelo • Garantem que somente objetos válidos sejam persistidos • Métodos que disparam • create • save • update • update_attributes
3.
Obrigatório class Person <
ActiveRecord::Base validates :name, presence: true validates_presence_of :idade end
4.
Tamanho class Person <
ActiveRecord::Base validates :name, length: { minimum: 2 } validates :bio, length: { maximum: 500 } validates :password, length: { in: 6..20 } validates :registration_number, length: { is: 6 } end
5.
Tamanho class Essay <
ActiveRecord::Base validates :content, length: { minimum: 300, maximum: 400, too_short: "minimo %{count} caracteres", too_long: "maximo %{count} caracteres" } end
6.
Numéricos class Player <
ActiveRecord::Base validates :points, numericality: true validates :games_played, numericality: { only_integer: true } end
7.
Numéricos :greater_than :equal_to :greater_than_or_equal_to :odd :less_than :even :less_than_or_equal_to ! !
8.
Unicidade class Account <
ActiveRecord::Base validates :email, uniqueness: true end
9.
Unicidade class Holiday <
ActiveRecord::Base validates :name, uniqueness: { scope: :year, message: "should happen once per year" } end
10.
Unicidade class Person <
ActiveRecord::Base validates :name, uniqueness: { case_sensitive: false } end
Télécharger maintenant