wheels 0.0.42 → 0.0.43
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/users_controller.rb +0 -1
- data/app/models/page.rb +1 -1
- data/app/views/pages/_form.html.haml +17 -0
- data/app/views/pages/_form_fields.html.haml +2 -2
- data/wheels.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.43
|
data/app/models/page.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Page < ActiveRecord::Base
|
2
2
|
has_many :attachments
|
3
|
-
|
3
|
+
validates :title, :presence=>true
|
4
4
|
belongs_to :parent, :class_name=>'Page', :foreign_key=>'parent_id'
|
5
5
|
has_many :children, :class_name=>'Page', :foreign_key=>'parent_id'
|
6
6
|
acts_as_taggable
|
@@ -8,3 +8,20 @@
|
|
8
8
|
= form_for form_object, {:url=>form_url} do |f|
|
9
9
|
= render :partial => "form_fields", :locals=>{:f=>f}
|
10
10
|
|
11
|
+
= content_for :head do
|
12
|
+
= javascript_include_tag 'jquery-validate/jquery.validate.pack'
|
13
|
+
|
14
|
+
:javascript
|
15
|
+
$(function(){
|
16
|
+
jQuery.validator.addMethod("verify_user", function(value, element, params) {
|
17
|
+
//alert($(element).attr('data-verify-user-path'));
|
18
|
+
xhr = $.ajax({
|
19
|
+
async: false,
|
20
|
+
url: $(element).attr('data-verify-user-path')+ '?password='+value
|
21
|
+
});
|
22
|
+
return xhr.responseText=="true";
|
23
|
+
}, "Password is incorrect.");
|
24
|
+
|
25
|
+
$('form').validate();
|
26
|
+
});
|
27
|
+
|
data/wheels.gemspec
CHANGED