nyros_form2 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f27409c9258c80f1515b0d286960fac7bb0e17a2f96daf78bf0c144fdb731623
|
4
|
+
data.tar.gz: aafb9bb7d22dfe6ba9cdfb6ff3d48b31af9a2fbb74eb1477bd9caf1e675c7752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89bdcb1e7432f84bf8fde9dad3961f0d2d7d4930c32bab8ab53d44abd45d5ccd19e4acde6c0209b8ae0df1febfd429cd9afe50244d416074257d92c2c8e0157f
|
7
|
+
data.tar.gz: 8b869b98e3eaf6b257fd9b7e8e29af159dd38c8037585ee6fe7898220668326af33d9a362250d17ff938e16ed9373f73304d9c4cff534a601d65e3bc9b5f63fb
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module NyrosForm2
|
2
2
|
class User < ApplicationRecord
|
3
3
|
validates :email,uniqueness: true, format: {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
with: URI::MailTo::EMAIL_REGEXP,
|
5
|
+
message: '*Please Enter Your Email'
|
6
|
+
}
|
10
7
|
validates_presence_of :name, message: "*Please Enter Your Name"
|
11
|
-
|
8
|
+
# svalidates_presence_of :mobile, message: "*Please Enter Your Mobile"
|
9
|
+
validates_format_of :mobile, :with => /\d[0-9]\)*\z/ , :message => "*Please Enter a Valid Mobile Number"
|
10
|
+
|
12
11
|
|
13
12
|
|
14
13
|
end
|
@@ -1,9 +1,15 @@
|
|
1
|
+
<script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.js"></script>
|
2
|
+
|
3
|
+
|
4
|
+
|
1
5
|
<body >
|
2
6
|
<div class="container" >
|
3
7
|
<div class="form-horizontal no-border form u-dimension-2"
|
4
|
-
style ="margin-top:
|
8
|
+
style ="margin-top: 100px; width: 450px;"align="center" >
|
5
9
|
|
6
|
-
|
10
|
+
|
11
|
+
<%= form_for @user , :url => {:action => "create", :controller => "users"} do |f| %>
|
12
|
+
|
7
13
|
<h2 align="center">User Form </h2>
|
8
14
|
|
9
15
|
|
@@ -33,16 +39,40 @@
|
|
33
39
|
|
34
40
|
<div class="form-group">
|
35
41
|
<div class="col-sm-12">
|
36
|
-
<%= f.submit "Submit", class: 'submitBtn btn btn-block btn-success btn', id: 'modal-submit' %>
|
42
|
+
<%= f.submit "Submit", class: 'submitBtn btn btn-block btn-success btn modal_btn', id: 'modal-submit' %>
|
37
43
|
</div>
|
38
44
|
</div>
|
39
45
|
<% end %>
|
40
46
|
</div>
|
41
47
|
|
42
48
|
</div>
|
49
|
+
</body>
|
50
|
+
|
51
|
+
<script type="text/javascript">
|
52
|
+
$(".modal_btn").click(function(){
|
53
|
+
|
54
|
+
jQuery.validator.addMethod("lettersonly", function(value, element) {
|
55
|
+
return this.optional(element) || /^[a-zA-Z\\ \\.\\]+$/.test(value);
|
56
|
+
}, "Letters only please");
|
57
|
+
|
58
|
+
$(".new_rating").validate();
|
59
|
+
|
60
|
+
$("#rating_comments").rules("add", {
|
61
|
+
required:true,
|
62
|
+
lettersonly: true,
|
63
|
+
minlength:10,
|
64
|
+
maxlength:300,
|
65
|
+
messages: {
|
66
|
+
required: "*Please Enter comment."
|
67
|
+
}
|
68
|
+
});
|
69
|
+
})
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</script>
|
43
74
|
|
44
75
|
|
45
|
-
</body>
|
46
76
|
<style type="text/css">
|
47
77
|
.form-group{
|
48
78
|
width:356px;
|
data/lib/nyros_form2/version.rb
CHANGED