Permalink
Browse files

Styling

  • Loading branch information...
1 parent 94d7083 commit 6372868c00c286daa941be1fe98cd5731afbf9b6 @bogdan committed Feb 9, 2012
View
16 README
@@ -1,16 +0,0 @@
-An example app displaying the usage of the sorcery gem:
-https://github.com/NoamB/sorcery
-
-Files of interest:
-
-app/controllers/*
-
-app/mailers/user_mailer.rb
-
-app/models/user.rb
-
-app/views/*
-
-config/initializers/sorcery.rb
-
-db/migrate/*
View
@@ -0,0 +1,7 @@
+# AjaxSubmit Demo
+
+An example app displaying the usage of the ajax submit javascript library.
+
+This application is [available live](http://ajaxsubmit.heroku.com)
+
+[Ajaxsubmit source](https://github.com/bogdan/ajaxsubmit)
View
@@ -10,8 +10,8 @@ class User < ActiveRecord::Base
accepts_nested_attributes_for :providers
- validates_format_of :email, :with => /^[A-Z0-9_\.%\+\-']+@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2,4}|museum|travel)$/i
- validates_uniqueness_of :email
- validates_length_of :password, :minimum => 3, :message => "password must be at least 3 characters long", :if => :password
- validates_confirmation_of :password, :message => "should match confirmation", :if => :password
+ validates_format_of :email, :with => /^[A-Z0-9_\.%\+\-']+@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2,4}|museum|travel)$/i, :message => "Email is invalid"
+ validates_uniqueness_of :email, :message => "Email has already been taken"
+ validates_length_of :password, :minimum => 3, :message => "Password must be at least 3 characters long", :if => :password
+ validates_confirmation_of :password, :message => "Password should match confirmation", :if => :password
end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,4 +1,5 @@
$(function () {
+ $.errors.format ='<div class="validation"><div class="validation-message"></div><div class="arrow"></div></div>'
$('.ajax-form').ajaxForm();
});
@@ -0,0 +1,56 @@
+[validate] {
+ position: relative;
+}
+[validate].error input {
+ background-color: #ffe3e3;
+ border-color: #e05c5c;
+}
+[validate].error .validation {
+ opacity: 1;
+ visibility: visible;
+}
+[validate].error:hover .validation {
+ background: #f03333;
+ bottom: 29px;
+ display: block;
+ height: auto;
+ left: 0;
+ line-height: 16px;
+ max-height: 40px;
+ overflow: visible;
+ padding: 7px 10px;
+ position: absolute;
+ text-indent: 0;
+ width: 238px;
+ z-index: 10;
+}
+[validate].error:hover .validation .arrow {
+ background: url('/images/validation-error.png') 0 0 no-repeat;
+ bottom: -7px;
+ height: 7px;
+ position: absolute;
+ width: 7px;
+}
+[validate] input {
+ background: #fff;
+ border: 1px solid #ccc;
+ font-size: 12px;
+ padding: 6px 8px;
+ width: 240px;
+ border-radius: 2px;
+}
+[validate] .validation {
+ background: url('/images/validation-error-notice.png') 0 0 no-repeat;
+ bottom: 6px;
+ color: #fff;
+ font-size: 11px;
+ height: 16px;
+ left: 237px;
+ opacity: 0;
+ overflow: hidden;
+ position: absolute;
+ text-indent: 16px;
+ visibility: hidden;
+ width: 16px;
+}
+

0 comments on commit 6372868

Please sign in to comment.