nyros_form2 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/nyros_form2/users.js +3 -0
- data/app/assets/stylesheets/nyros_form2/users.css +0 -161
- data/app/controllers/nyros_form2/users_controller.rb +0 -2
- data/app/models/nyros_form2/user.rb +1 -7
- data/app/views/layouts/nyros_form2/application.html.erb +11 -1
- data/app/views/nyros_form2/users/edit.html.erb +34 -41
- data/app/views/nyros_form2/users/index.html.erb +31 -35
- data/app/views/nyros_form2/users/new.html.erb +38 -42
- data/lib/nyros_form2/version.rb +1 -1
- metadata +2 -9
- data/app/assets/stylesheets/nyros_form2/failures.css +0 -4
- data/app/controllers/nyros_form2/failures_controller.rb +0 -9
- data/app/models/nyros_form2/failure.rb +0 -4
- data/app/views/nyros_form2/failures/index.html.erb +0 -10
- data/app/views/nyros_form2/users/delete.html.erb +0 -2
- data/app/views/nyros_form2/users/show.html.erb +0 -2
- data/app/views/nyros_form2/users/update.html.erb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acce880c1951e108b6a6ea4ccf0eb66d39b7caaec92d58e2473ff4a8168cf1b9
|
4
|
+
data.tar.gz: a0ebd0fa64dbe8777dbcbbd90cd52ca2a6a18d8ad2bbd941b6c5863dd402eea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02e4b0e05eb898a9917d6a26dfaf52ea199c3fcae9b4e59de2877d0ce7b1f2cdbaa8599cad1225ac491474ab8e777cc8276b8f585079ee940305280cd7fffb0a
|
7
|
+
data.tar.gz: 116f28eb08af4a0b1fcf42508be31492dc86975f94a086ecac6a9640e59aac4503097255bc63ba2fce5e64d920ca5e119996891db6059f3c0f285a9bda2fd661
|
@@ -2,164 +2,3 @@
|
|
2
2
|
Place all the styles related to the matching controller here.
|
3
3
|
They will automatically be included in application.css.
|
4
4
|
*/
|
5
|
-
.form-group{
|
6
|
-
width:356px;
|
7
|
-
margin-bottom: 30px;
|
8
|
-
}
|
9
|
-
|
10
|
-
.form{
|
11
|
-
padding-top: 30px;
|
12
|
-
padding-bottom: 50px;
|
13
|
-
}
|
14
|
-
.col-sm-12{
|
15
|
-
padding-left: 0px;
|
16
|
-
padding-right: 0px;
|
17
|
-
}
|
18
|
-
|
19
|
-
#user_remember_me{
|
20
|
-
margin-right:0px;
|
21
|
-
}
|
22
|
-
.forgot_pwd{
|
23
|
-
padding-left: 90px;
|
24
|
-
}
|
25
|
-
|
26
|
-
a:hover{
|
27
|
-
text-decoration-line: none;
|
28
|
-
}
|
29
|
-
|
30
|
-
#flash_alert{
|
31
|
-
color: red;
|
32
|
-
}
|
33
|
-
|
34
|
-
#form_email{
|
35
|
-
margin-left: 23px;
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
#sign_in_from{
|
41
|
-
margin-left: 400px;
|
42
|
-
}
|
43
|
-
|
44
|
-
/*.new_user{
|
45
|
-
margin-top: 100px;
|
46
|
-
}*/
|
47
|
-
|
48
|
-
.form1 {
|
49
|
-
margin: 0 auto;
|
50
|
-
width: 470px;
|
51
|
-
background-color: white;
|
52
|
-
padding-left: 0px;
|
53
|
-
}
|
54
|
-
|
55
|
-
.form label {
|
56
|
-
display: inline-block;
|
57
|
-
text-align: right;
|
58
|
-
float: left;
|
59
|
-
|
60
|
-
}
|
61
|
-
|
62
|
-
.modal_form{
|
63
|
-
margin-top: 0px;
|
64
|
-
}
|
65
|
-
|
66
|
-
.homepage_dish{
|
67
|
-
height: 100%;
|
68
|
-
width: 50%;
|
69
|
-
position:fixed;
|
70
|
-
}
|
71
|
-
|
72
|
-
.login{
|
73
|
-
padding-right: 20px;
|
74
|
-
color:#0066ff;
|
75
|
-
font-size: 20.3px;
|
76
|
-
line-height: 1.44359;
|
77
|
-
border: 0px;
|
78
|
-
font-weight:700;
|
79
|
-
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
.login a:hover{
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
|
-
.signup{
|
88
|
-
padding-right: 100px;
|
89
|
-
color:#0066ff;
|
90
|
-
|
91
|
-
font-size: 20.3px;
|
92
|
-
line-height: 1.44359;
|
93
|
-
border: 0px;
|
94
|
-
font-weight:700;
|
95
|
-
|
96
|
-
|
97
|
-
}
|
98
|
-
|
99
|
-
.top-left {
|
100
|
-
position: absolute;
|
101
|
-
top:450px;
|
102
|
-
left:10px;
|
103
|
-
color: #f79b9b;
|
104
|
-
font-size: 50px;
|
105
|
-
font-weight: 900;
|
106
|
-
|
107
|
-
}
|
108
|
-
|
109
|
-
.top-left:hover{
|
110
|
-
color: #f79b9b;
|
111
|
-
}
|
112
|
-
|
113
|
-
.bottom-right {
|
114
|
-
|
115
|
-
}
|
116
|
-
.bottom_img{
|
117
|
-
width: 300px;
|
118
|
-
height: 300px;
|
119
|
-
}
|
120
|
-
.main_header{
|
121
|
-
font-weight: 800;
|
122
|
-
font-size:40px;
|
123
|
-
color: black;
|
124
|
-
}
|
125
|
-
|
126
|
-
a:hover{
|
127
|
-
text-decoration-line: none;
|
128
|
-
|
129
|
-
}
|
130
|
-
|
131
|
-
.u-dimension-2 {
|
132
|
-
box-shadow: 0 0 0 1px rgba(67,41,163,.1), 0 1px 8px 0 rgba(67,41,163,.1);
|
133
|
-
}
|
134
|
-
|
135
|
-
.form {
|
136
|
-
margin: 0 auto;
|
137
|
-
width: 470px;
|
138
|
-
background-color: white;
|
139
|
-
padding-left: 0px;
|
140
|
-
}
|
141
|
-
|
142
|
-
|
143
|
-
.form input{
|
144
|
-
margin-right: 180px;
|
145
|
-
}
|
146
|
-
|
147
|
-
.err {
|
148
|
-
color: red;
|
149
|
-
font-size: 14px;
|
150
|
-
}
|
151
|
-
|
152
|
-
.error {
|
153
|
-
color: red;
|
154
|
-
font-size: 13px;
|
155
|
-
}
|
156
|
-
|
157
|
-
|
158
|
-
#flash_alert{
|
159
|
-
color: red;
|
160
|
-
font-size: 14px;
|
161
|
-
}
|
162
|
-
|
163
|
-
/*label{
|
164
|
-
margin-bottom: 5px;
|
165
|
-
}*/
|
@@ -1,11 +1,5 @@
|
|
1
1
|
module NyrosForm2
|
2
2
|
class User < ApplicationRecord
|
3
|
-
|
4
|
-
# validates_presence_of :name, message: "*Please Enter Your Name"
|
5
|
-
# # svalidates_presence_of :mobile, message: "*Please Enter Your Mobile"
|
6
|
-
# validates_format_of :mobile, :with => /\d[0-9]\)*\z/ , :message => "*Please Enter a Valid Mobile Number"
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
validates :email, :uniqueness => true
|
10
4
|
end
|
11
5
|
end
|
@@ -4,10 +4,20 @@
|
|
4
4
|
<title>Nyros form2</title>
|
5
5
|
<%= csrf_meta_tags %>
|
6
6
|
<%= csp_meta_tag %>
|
7
|
-
|
8
7
|
<%= stylesheet_link_tag "nyros_form2/application", media: "all" %>
|
9
8
|
<%= javascript_include_tag "nyros_form2/application" %>
|
9
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js">
|
10
|
+
</script>
|
11
|
+
|
12
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
13
|
+
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.1/jquery.validate.min.js"></script>
|
10
14
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
|
15
|
+
|
16
|
+
|
17
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
|
18
|
+
|
19
|
+
|
20
|
+
|
11
21
|
</head>
|
12
22
|
<body>
|
13
23
|
|
@@ -1,47 +1,7 @@
|
|
1
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js">
|
2
|
-
|
3
|
-
</script>
|
4
|
-
|
5
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
6
|
-
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.1/jquery.validate.min.js"></script>
|
7
|
-
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
$(function() {
|
11
|
-
$("form[name='myForm']").validate({
|
12
|
-
rules: {
|
13
|
-
name: "required",
|
14
|
-
email: {
|
15
|
-
required: true,
|
16
|
-
email: true
|
17
|
-
},
|
18
|
-
mobile: {
|
19
|
-
required: true,
|
20
|
-
digits: true,
|
21
|
-
minlength: 10,
|
22
|
-
maxlength: 10,
|
23
|
-
}
|
24
|
-
},
|
25
|
-
// Specify validation error messages
|
26
|
-
messages: {
|
27
|
-
name: "Please enter your firstname",
|
28
|
-
mobile: {
|
29
|
-
required: "Please Enter mobile number",
|
30
|
-
minlength: "Your Mobile must be at least 10 numbers long"
|
31
|
-
},
|
32
|
-
email: "Please enter a valid email address"
|
33
|
-
},
|
34
|
-
// in the "action" attribute of the form when valid
|
35
|
-
submitHandler: function(form) {
|
36
|
-
form.submit();
|
37
|
-
}
|
38
|
-
});
|
39
|
-
});
|
40
|
-
</script>
|
41
1
|
<body >
|
42
2
|
<div class="container" >
|
43
3
|
<div class="form-horizontal no-border form u-dimension-2"
|
44
|
-
|
4
|
+
style ="margin-top: 100px; width: 450px;"align="center" >
|
45
5
|
<%= form_for @user, :user => {}, :html => { :name =>"myForm"} do |f| %>
|
46
6
|
<h2 align="center">User Form </h2>
|
47
7
|
|
@@ -55,6 +15,7 @@
|
|
55
15
|
<div class="form-group">
|
56
16
|
<div class="col-sm-12">
|
57
17
|
<%= f.label :email %>
|
18
|
+
<span class="err"><%= @user.errors[:email].join('. ') %></span><br/>
|
58
19
|
<%= f.email_field :email, name: "email", autocomplete: "email",class: 'form-control'%>
|
59
20
|
</div>
|
60
21
|
</div>
|
@@ -80,6 +41,38 @@
|
|
80
41
|
</div>
|
81
42
|
</body>
|
82
43
|
|
44
|
+
<script type="text/javascript">
|
45
|
+
$(function() {
|
46
|
+
$("form[name='myForm']").validate({
|
47
|
+
rules: {
|
48
|
+
name: "required",
|
49
|
+
email: {
|
50
|
+
required: true,
|
51
|
+
email: true
|
52
|
+
},
|
53
|
+
mobile: {
|
54
|
+
required: true,
|
55
|
+
digits: true,
|
56
|
+
minlength: 10,
|
57
|
+
maxlength: 10,
|
58
|
+
}
|
59
|
+
},
|
60
|
+
// Specify validation error messages
|
61
|
+
messages: {
|
62
|
+
name: "Please enter your firstname",
|
63
|
+
mobile: {
|
64
|
+
required: "Please Enter mobile number",
|
65
|
+
minlength: "Your Mobile must be at least 10 numbers long"
|
66
|
+
},
|
67
|
+
email: "Please enter a valid email address"
|
68
|
+
},
|
69
|
+
// in the "action" attribute of the form when valid
|
70
|
+
submitHandler: function(form) {
|
71
|
+
form.submit();
|
72
|
+
}
|
73
|
+
});
|
74
|
+
});
|
75
|
+
</script>
|
83
76
|
|
84
77
|
<style type="text/css">
|
85
78
|
.form-group{
|
@@ -1,34 +1,29 @@
|
|
1
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
2
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
|
3
|
-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
4
|
-
|
5
1
|
<br><br>
|
6
2
|
<div class="container">
|
7
|
-
<
|
8
|
-
|
9
|
-
<%= link_to "Add user", new_user_path, :class => 'btn btn-sm btn-success' %>
|
10
|
-
</div><br>
|
3
|
+
<h2>Users</h2>
|
4
|
+
<%= link_to "Add user", new_user_path, :class => 'btn btn-sm btn-success' %> <br><br>
|
11
5
|
<table class="table">
|
12
|
-
<thead>
|
13
|
-
<tr>
|
14
|
-
<th>Id</th>
|
15
|
-
<th>Name</th>
|
16
|
-
<th>Email</th>
|
17
|
-
<th>Mobile</th>
|
18
|
-
<th>Actions</th>
|
19
|
-
</tr>
|
20
|
-
</thead>
|
21
|
-
<tbody>
|
22
|
-
<% @users.each do |u| %>
|
23
|
-
<tr>
|
24
|
-
<td><%= u.id %> </td>
|
25
|
-
<td><%= u.name %></td>
|
26
|
-
<td><%= u.email %></td>
|
27
|
-
<td><%= u.mobile %></td>
|
28
|
-
<td>
|
29
|
-
<%= link_to "Edit", edit_user_path(u.id), class: 'btn btn-sm btn-info' %>
|
30
6
|
|
31
|
-
|
7
|
+
<thead>
|
8
|
+
<tr>
|
9
|
+
<th>Id</th>
|
10
|
+
<th>Name</th>
|
11
|
+
<th>Email</th>
|
12
|
+
<th>Mobile</th>
|
13
|
+
<th>Actions</th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
|
17
|
+
<tbody>
|
18
|
+
<% @users.each do |u| %>
|
19
|
+
<tr>
|
20
|
+
<td><%= u.id %> </td>
|
21
|
+
<td><%= u.name %></td>
|
22
|
+
<td><%= u.email %></td>
|
23
|
+
<td><%= u.mobile %></td>
|
24
|
+
<td>
|
25
|
+
<%= link_to "Edit", edit_user_path(u.id), class: 'btn btn-sm btn-info' %>
|
26
|
+
<%= link_to 'Delete', '#',{:class=>"btn btn-danger btn-sm", "data-toggle"=>"modal", "data-target" => "#delete-#{u.id}"} %>
|
32
27
|
<div class="modal fade " id="delete-<%= u.id %>">
|
33
28
|
<div class="modal-dialog ">
|
34
29
|
<div class="modal-content">
|
@@ -45,14 +40,15 @@
|
|
45
40
|
</div>
|
46
41
|
</div>
|
47
42
|
</div>
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
</table>
|
53
|
-
|
54
|
-
|
55
|
-
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
<% end %>
|
46
|
+
</tbody>
|
47
|
+
</table>
|
56
48
|
</div>
|
57
49
|
|
50
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
51
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
|
52
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
53
|
+
|
58
54
|
|
@@ -1,45 +1,3 @@
|
|
1
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js">
|
2
|
-
|
3
|
-
</script>
|
4
|
-
|
5
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
6
|
-
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.1/jquery.validate.min.js"></script>
|
7
|
-
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
$(function() {
|
11
|
-
$("form[name='myForm']").validate({
|
12
|
-
rules: {
|
13
|
-
name: "required",
|
14
|
-
email: {
|
15
|
-
required: true,
|
16
|
-
email: true
|
17
|
-
},
|
18
|
-
mobile: {
|
19
|
-
required: true,
|
20
|
-
digits: true,
|
21
|
-
minlength: 10,
|
22
|
-
maxlength: 10,
|
23
|
-
}
|
24
|
-
},
|
25
|
-
// Specify validation error messages
|
26
|
-
messages: {
|
27
|
-
name: "Please enter your firstname",
|
28
|
-
mobile: {
|
29
|
-
required: "Please Enter mobile number",
|
30
|
-
minlength: "Your Mobile must be at least 10 numbers long"
|
31
|
-
},
|
32
|
-
email: "Please enter a valid email address"
|
33
|
-
},
|
34
|
-
// in the "action" attribute of the form when valid
|
35
|
-
submitHandler: function(form) {
|
36
|
-
form.submit();
|
37
|
-
}
|
38
|
-
});
|
39
|
-
});
|
40
|
-
|
41
|
-
|
42
|
-
</script>
|
43
1
|
<body >
|
44
2
|
<div class="container" >
|
45
3
|
<div class="form-horizontal no-border form u-dimension-2"
|
@@ -84,6 +42,44 @@
|
|
84
42
|
</body>
|
85
43
|
|
86
44
|
|
45
|
+
|
46
|
+
|
47
|
+
<script type="text/javascript">
|
48
|
+
$(function() {
|
49
|
+
$("form[name='myForm']").validate({
|
50
|
+
rules: {
|
51
|
+
name: "required",
|
52
|
+
email: {
|
53
|
+
required: true,
|
54
|
+
email: true
|
55
|
+
},
|
56
|
+
mobile: {
|
57
|
+
required: true,
|
58
|
+
digits: true,
|
59
|
+
minlength: 10,
|
60
|
+
maxlength: 10,
|
61
|
+
}
|
62
|
+
},
|
63
|
+
// Specify validation error messages
|
64
|
+
messages: {
|
65
|
+
name: "Please enter your firstname",
|
66
|
+
mobile: {
|
67
|
+
required: "Please Enter mobile number",
|
68
|
+
minlength: "Your Mobile must be at least 10 numbers long"
|
69
|
+
},
|
70
|
+
email: "Please enter a valid email address"
|
71
|
+
},
|
72
|
+
// in the "action" attribute of the form when valid
|
73
|
+
submitHandler: function(form) {
|
74
|
+
form.submit();
|
75
|
+
}
|
76
|
+
});
|
77
|
+
});
|
78
|
+
|
79
|
+
|
80
|
+
</script>
|
81
|
+
|
82
|
+
|
87
83
|
<style type="text/css">
|
88
84
|
.form-group{
|
89
85
|
width:356px;
|
data/lib/nyros_form2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nyros_form2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- raju rekadi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,10 +53,8 @@ files:
|
|
53
53
|
- app/assets/javascripts/nyros_form2/failures.js
|
54
54
|
- app/assets/javascripts/nyros_form2/users.js
|
55
55
|
- app/assets/stylesheets/nyros_form2/application.css
|
56
|
-
- app/assets/stylesheets/nyros_form2/failures.css
|
57
56
|
- app/assets/stylesheets/nyros_form2/users.css
|
58
57
|
- app/controllers/nyros_form2/application_controller.rb
|
59
|
-
- app/controllers/nyros_form2/failures_controller.rb
|
60
58
|
- app/controllers/nyros_form2/users_controller.rb
|
61
59
|
- app/helpers/nyros_form2/application_helper.rb
|
62
60
|
- app/helpers/nyros_form2/failures_helper.rb
|
@@ -64,16 +62,11 @@ files:
|
|
64
62
|
- app/jobs/nyros_form2/application_job.rb
|
65
63
|
- app/mailers/nyros_form2/application_mailer.rb
|
66
64
|
- app/models/nyros_form2/application_record.rb
|
67
|
-
- app/models/nyros_form2/failure.rb
|
68
65
|
- app/models/nyros_form2/user.rb
|
69
66
|
- app/views/layouts/nyros_form2/application.html.erb
|
70
|
-
- app/views/nyros_form2/failures/index.html.erb
|
71
|
-
- app/views/nyros_form2/users/delete.html.erb
|
72
67
|
- app/views/nyros_form2/users/edit.html.erb
|
73
68
|
- app/views/nyros_form2/users/index.html.erb
|
74
69
|
- app/views/nyros_form2/users/new.html.erb
|
75
|
-
- app/views/nyros_form2/users/show.html.erb
|
76
|
-
- app/views/nyros_form2/users/update.html.erb
|
77
70
|
- config/routes.rb
|
78
71
|
- db/migrate/20191014071953_create_nyros_form2_users.rb
|
79
72
|
- lib/nyros_form2.rb
|