Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Styling

  • Loading branch information...
commit 6372868c00c286daa941be1fe98cd5731afbf9b6 1 parent 94d7083
Bogdan Gusiev authored
16  README
... ...
@@ -1,16 +0,0 @@
1  
-An example app displaying the usage of the sorcery gem:
2  
-https://github.com/NoamB/sorcery
3  
-
4  
-Files of interest:
5  
-
6  
-app/controllers/*
7  
-
8  
-app/mailers/user_mailer.rb
9  
-
10  
-app/models/user.rb
11  
-
12  
-app/views/*
13  
-
14  
-config/initializers/sorcery.rb
15  
-
16  
-db/migrate/*
7  README.md
Source Rendered
... ...
@@ -0,0 +1,7 @@
  1
+# AjaxSubmit Demo
  2
+
  3
+An example app displaying the usage of the ajax submit javascript library.
  4
+
  5
+This application is [available live](http://ajaxsubmit.heroku.com)
  6
+
  7
+[Ajaxsubmit source](https://github.com/bogdan/ajaxsubmit)
8  app/models/user.rb
@@ -10,8 +10,8 @@ class User < ActiveRecord::Base
10 10
   accepts_nested_attributes_for :providers
11 11
 
12 12
   
13  
-  validates_format_of :email, :with => /^[A-Z0-9_\.%\+\-']+@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2,4}|museum|travel)$/i 
14  
-  validates_uniqueness_of :email
15  
-  validates_length_of :password, :minimum => 3, :message => "password must be at least 3 characters long", :if => :password
16  
-  validates_confirmation_of :password, :message => "should match confirmation", :if => :password
  13
+  validates_format_of :email, :with => /^[A-Z0-9_\.%\+\-']+@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2,4}|museum|travel)$/i, :message => "Email is invalid"
  14
+  validates_uniqueness_of :email, :message => "Email has already been taken"
  15
+  validates_length_of :password, :minimum => 3, :message => "Password must be at least 3 characters long", :if => :password
  16
+  validates_confirmation_of :password, :message => "Password should match confirmation", :if => :password
17 17
 end
BIN  public/images/validation-error-notice.png
BIN  public/images/validation-error.png
1  public/javascripts/application.js
... ...
@@ -1,4 +1,5 @@
1 1
 $(function () {
  2
+  $.errors.format ='<div class="validation"><div class="validation-message"></div><div class="arrow"></div></div>' 
2 3
   $('.ajax-form').ajaxForm();
3 4
 });
4 5
 
56  public/stylesheets/ajaxsubmit.css
... ...
@@ -0,0 +1,56 @@
  1
+[validate] {
  2
+  position: relative;
  3
+}
  4
+[validate].error input {
  5
+  background-color: #ffe3e3;
  6
+  border-color: #e05c5c;
  7
+}
  8
+[validate].error .validation {
  9
+  opacity: 1;
  10
+  visibility: visible;
  11
+}
  12
+[validate].error:hover .validation {
  13
+  background: #f03333;
  14
+  bottom: 29px;
  15
+  display: block;
  16
+  height: auto;
  17
+  left: 0;
  18
+  line-height: 16px;
  19
+  max-height: 40px;
  20
+  overflow: visible;
  21
+  padding: 7px 10px;
  22
+  position: absolute;
  23
+  text-indent: 0;
  24
+  width: 238px;
  25
+  z-index: 10;
  26
+}
  27
+[validate].error:hover .validation .arrow {
  28
+  background: url('/images/validation-error.png') 0 0 no-repeat;
  29
+  bottom: -7px;
  30
+  height: 7px;
  31
+  position: absolute;
  32
+  width: 7px;
  33
+}
  34
+[validate] input {
  35
+  background: #fff;
  36
+  border: 1px solid #ccc;
  37
+  font-size: 12px;
  38
+  padding: 6px 8px;
  39
+  width: 240px;
  40
+  border-radius: 2px;
  41
+}
  42
+[validate] .validation {
  43
+  background: url('/images/validation-error-notice.png') 0 0 no-repeat;
  44
+  bottom: 6px;
  45
+  color: #fff;
  46
+  font-size: 11px;
  47
+  height: 16px;
  48
+  left: 237px;
  49
+  opacity: 0;
  50
+  overflow: hidden;
  51
+  position: absolute;
  52
+  text-indent: 16px;
  53
+  visibility: hidden;
  54
+  width: 16px;
  55
+}
  56
+

0 notes on commit 6372868

Please sign in to comment.
Something went wrong with that request. Please try again.