nyros_form2 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/nyros_form2/users.css +161 -0
- data/app/controllers/nyros_form2/users_controller.rb +13 -9
- data/app/models/nyros_form2/user.rb +7 -7
- data/app/views/nyros_form2/users/edit.html.erb +201 -149
- data/app/views/nyros_form2/users/index.html.erb +4 -4
- data/app/views/nyros_form2/users/new.html.erb +196 -171
- data/lib/nyros_form2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1abd60dbb7cacbdcbc0b63428a9bf99bfdf88ba5cca537794539ccca312bb41e
|
4
|
+
data.tar.gz: c6c538fb70ff08ef2d2f37bd7eafbff163e2ebc3deb3c968aedfc20f634c3f92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d24b1e03aabb19a633b6d00f4e809735e1d9c23d91918a84e9d7adaa42f3117ab5d2f6038c6aeab50138dd93a8cc35a14d9f46d9ead894e87bb0abdbf9e5510
|
7
|
+
data.tar.gz: 0677da39d9a78ebb1729b66a3996db11375abce51c9d427a55b7d85dbd5edb3715a32bc48e9325ea1732966af8f7bbf673bf8882866d5d13fb70d4b8c469012f
|
@@ -2,3 +2,164 @@
|
|
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
|
+
}*/
|
@@ -3,23 +3,26 @@ require_dependency "nyros_form2/application_controller"
|
|
3
3
|
module NyrosForm2
|
4
4
|
class UsersController < ApplicationController
|
5
5
|
def index
|
6
|
-
|
6
|
+
@users = User.all
|
7
7
|
end
|
8
8
|
|
9
9
|
def new
|
10
|
-
|
10
|
+
@user = User.new
|
11
11
|
end
|
12
12
|
|
13
13
|
def create
|
14
|
+
|
14
15
|
@user = User.new(user_params)
|
16
|
+
|
15
17
|
if @user.save
|
16
18
|
redirect_to users_path
|
17
|
-
|
18
19
|
else
|
19
|
-
|
20
|
+
render :new
|
20
21
|
end
|
21
22
|
end
|
22
|
-
|
23
|
+
|
24
|
+
|
25
|
+
|
23
26
|
|
24
27
|
def show
|
25
28
|
@user = User.find(params[:id])
|
@@ -47,9 +50,10 @@ module NyrosForm2
|
|
47
50
|
format.js { render :layout => false }
|
48
51
|
end
|
49
52
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
53
|
+
|
54
|
+
private
|
55
|
+
def user_params
|
56
|
+
params.permit(:name, :email, :mobile)
|
57
|
+
end
|
54
58
|
end
|
55
59
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module NyrosForm2
|
2
2
|
class User < ApplicationRecord
|
3
|
-
validates :email,uniqueness: true, format: {
|
4
|
-
|
5
|
-
|
6
|
-
}
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
# validates :email,uniqueness: true, format: {
|
4
|
+
# with: URI::MailTo::EMAIL_REGEXP,
|
5
|
+
# message: '*Please Enter Your Email'
|
6
|
+
# }
|
7
|
+
# validates_presence_of :name, message: "*Please Enter Your Name"
|
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
10
|
|
11
11
|
|
12
12
|
|
@@ -1,188 +1,216 @@
|
|
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
|
+
minlength: 10
|
21
|
+
}
|
22
|
+
},
|
23
|
+
// Specify validation error messages
|
24
|
+
messages: {
|
25
|
+
name: "Please enter your firstname",
|
26
|
+
mobile: {
|
27
|
+
required: "Please Enter mobile number",
|
28
|
+
minlength: "Your Mobile must be at least 10 characters long"
|
29
|
+
},
|
30
|
+
email: "Please enter a valid email address"
|
31
|
+
},
|
32
|
+
// in the "action" attribute of the form when valid
|
33
|
+
submitHandler: function(form) {
|
34
|
+
form.submit();
|
35
|
+
}
|
36
|
+
});
|
37
|
+
});
|
38
|
+
</script>
|
1
39
|
<body >
|
2
|
-
<div class="container" >
|
3
|
-
|
4
|
-
|
40
|
+
<div class="container" >
|
41
|
+
<div class="form-horizontal no-border form u-dimension-2"
|
42
|
+
style ="margin-top: 100px; width: 450px;"align="center" >
|
43
|
+
<%= form_for @user, :user => {}, :html => { :name =>"myForm"} do |f| %>
|
44
|
+
<h2 align="center">User Form </h2>
|
45
|
+
|
46
|
+
<div class="form-group">
|
47
|
+
<div class="col-sm-12">
|
48
|
+
<%= f.label :name %>
|
49
|
+
<%= f.text_field :name, autocomplete: "current-name",name: "name", class: 'form-control'%>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<div class="form-group">
|
54
|
+
<div class="col-sm-12">
|
55
|
+
<%= f.label :email %>
|
56
|
+
<%= f.email_field :email, name: "email", autocomplete: "email",class: 'form-control'%>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="form-group">
|
61
|
+
<div class="col-sm-12">
|
62
|
+
<%= f.label :mobile %>
|
63
|
+
<%= f.text_field :mobile,name: "mobile", autocomplete: "current-name",class: 'form-control'%>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div class="form-group">
|
68
|
+
<div class="col-sm-12">
|
69
|
+
<%= f.submit "Submit", class: 'submitBtn btn btn-block btn-success btn modal_btn', id: 'modal-submit' %>
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
<% end %>
|
73
|
+
|
74
|
+
<div>
|
75
|
+
<%= link_to "Back", users_path, class: "btn btn-sm btn-info"%>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</body>
|
80
|
+
|
5
81
|
|
6
|
-
<%= form_for @user, url: {action: :update} do |f| %>
|
7
|
-
<h2 align="center">User Form </h2>
|
8
|
-
|
9
|
-
<div class="form-group">
|
10
|
-
<div class="col-sm-12">
|
11
|
-
<%= f.label :name %>
|
12
|
-
<span class="err"><%= @user.errors[:name].join('. ') %></span><br/>
|
13
|
-
<%= f.text_field :name, autocomplete: "current-name",class: 'form-control'%>
|
14
|
-
</div>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<div class="form-group">
|
18
|
-
<div class="col-sm-12">
|
19
|
-
<%= f.label :email %>
|
20
|
-
<span class="err"><%= @user.errors[:email].join('. ') %></span><br/>
|
21
|
-
<%= f.email_field :email, autocomplete: "email",class: 'form-control'%>
|
22
|
-
</div>
|
23
|
-
</div>
|
24
|
-
|
25
|
-
<div class="form-group">
|
26
|
-
<div class="col-sm-12">
|
27
|
-
<%= f.label :mobile %>
|
28
|
-
<span class="err"><%= @user.errors[:mobile].join('. ') %></span><br/>
|
29
|
-
<%= f.text_field :mobile, autocomplete: "current-name",class: 'form-control'%>
|
30
|
-
</div>
|
31
|
-
</div>
|
32
|
-
|
33
|
-
<div class="form-group">
|
34
|
-
<div class="col-sm-12">
|
35
|
-
<%= f.submit "Submit", class: 'submitBtn btn btn-block btn-success btn', id: 'modal-submit' %>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
<% end %>
|
39
|
-
|
40
|
-
<div>
|
41
|
-
<%= link_to "Back", users_path, class: 'btn btn-sm btn-info' %>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
|
45
|
-
</div>
|
46
|
-
|
47
|
-
|
48
|
-
</body>
|
49
82
|
<style type="text/css">
|
50
83
|
.form-group{
|
51
|
-
|
84
|
+
width:356px;
|
85
|
+
margin-bottom: 30px;
|
52
86
|
}
|
53
87
|
|
54
88
|
.form{
|
55
|
-
|
56
|
-
|
57
|
-
padding-top: 30px;
|
58
|
-
padding-bottom: 50px;
|
89
|
+
padding-top: 30px;
|
90
|
+
padding-bottom: 50px;
|
59
91
|
}
|
60
92
|
.col-sm-12{
|
61
|
-
|
62
|
-
|
93
|
+
padding-left: 0px;
|
94
|
+
padding-right: 0px;
|
63
95
|
}
|
64
96
|
|
65
|
-
|
66
|
-
|
67
97
|
#user_remember_me{
|
68
|
-
|
98
|
+
margin-right:0px;
|
69
99
|
}
|
70
100
|
.forgot_pwd{
|
71
|
-
|
101
|
+
padding-left: 90px;
|
72
102
|
}
|
73
103
|
|
74
104
|
a:hover{
|
75
105
|
text-decoration-line: none;
|
76
|
-
|
77
106
|
}
|
78
107
|
|
79
108
|
#flash_alert{
|
80
|
-
|
109
|
+
color: red;
|
81
110
|
}
|
82
111
|
|
112
|
+
#form_email{
|
113
|
+
margin-left: 23px;
|
114
|
+
}
|
83
115
|
|
84
|
-
#form_email{
|
85
|
-
margin-left: 23px;
|
86
|
-
}
|
87
116
|
|
88
117
|
|
118
|
+
#sign_in_from{
|
119
|
+
margin-left: 400px;
|
120
|
+
}
|
89
121
|
|
90
|
-
|
91
|
-
|
92
|
-
}
|
122
|
+
/*.new_user{
|
123
|
+
margin-top: 100px;
|
124
|
+
}*/
|
93
125
|
|
94
|
-
|
95
|
-
|
96
|
-
|
126
|
+
.form1 {
|
127
|
+
margin: 0 auto;
|
128
|
+
width: 470px;
|
129
|
+
background-color: white;
|
130
|
+
padding-left: 0px;
|
131
|
+
}
|
97
132
|
|
98
|
-
.
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
}
|
133
|
+
.form label {
|
134
|
+
display: inline-block;
|
135
|
+
text-align: right;
|
136
|
+
float: left;
|
137
|
+
|
138
|
+
}
|
104
139
|
|
105
|
-
.
|
106
|
-
|
107
|
-
|
108
|
-
float: left;
|
109
|
-
|
110
|
-
}
|
140
|
+
.modal_form{
|
141
|
+
margin-top: 0px;
|
142
|
+
}
|
111
143
|
|
112
|
-
.
|
113
|
-
|
114
|
-
|
144
|
+
.homepage_dish{
|
145
|
+
height: 100%;
|
146
|
+
width: 50%;
|
147
|
+
position:fixed;
|
148
|
+
}
|
149
|
+
|
150
|
+
.login{
|
151
|
+
padding-right: 20px;
|
152
|
+
color:#0066ff;
|
153
|
+
font-size: 20.3px;
|
154
|
+
line-height: 1.44359;
|
155
|
+
border: 0px;
|
156
|
+
font-weight:700;
|
115
157
|
|
116
|
-
.homepage_dish{
|
117
|
-
height: 100%;
|
118
|
-
width: 50%;
|
119
|
-
position:fixed;
|
120
|
-
}
|
121
|
-
|
122
|
-
.login{
|
123
|
-
padding-right: 20px;
|
124
|
-
color:#0066ff;
|
125
|
-
font-size: 20.3px;
|
126
|
-
line-height: 1.44359;
|
127
|
-
border: 0px;
|
128
|
-
font-weight:700;
|
129
158
|
|
159
|
+
}
|
130
160
|
|
131
|
-
|
161
|
+
.login a:hover{
|
132
162
|
|
133
|
-
|
163
|
+
}
|
134
164
|
|
135
|
-
|
165
|
+
.signup{
|
166
|
+
padding-right: 100px;
|
167
|
+
color:#0066ff;
|
168
|
+
|
169
|
+
font-size: 20.3px;
|
170
|
+
line-height: 1.44359;
|
171
|
+
border: 0px;
|
172
|
+
font-weight:700;
|
136
173
|
|
137
|
-
.signup{
|
138
|
-
padding-right: 100px;
|
139
|
-
color:#0066ff;
|
140
|
-
|
141
|
-
font-size: 20.3px;
|
142
|
-
line-height: 1.44359;
|
143
|
-
border: 0px;
|
144
|
-
font-weight:700;
|
145
174
|
|
175
|
+
}
|
146
176
|
|
147
|
-
|
177
|
+
.top-left {
|
178
|
+
position: absolute;
|
179
|
+
top:450px;
|
180
|
+
left:10px;
|
181
|
+
color: #f79b9b;
|
182
|
+
font-size: 50px;
|
183
|
+
font-weight: 900;
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
.top-left:hover{
|
188
|
+
color: #f79b9b;
|
189
|
+
}
|
190
|
+
|
191
|
+
.bottom-right {
|
192
|
+
|
193
|
+
}
|
194
|
+
.bottom_img{
|
195
|
+
width: 300px;
|
196
|
+
height: 300px;
|
197
|
+
}
|
198
|
+
.main_header{
|
199
|
+
font-weight: 800;
|
200
|
+
font-size:40px;
|
201
|
+
color: black;
|
202
|
+
}
|
203
|
+
|
204
|
+
a:hover{
|
205
|
+
text-decoration-line: none;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
.u-dimension-2 {
|
210
|
+
box-shadow: 0 0 0 1px rgba(67,41,163,.1), 0 1px 8px 0 rgba(67,41,163,.1);
|
211
|
+
}
|
148
212
|
|
149
|
-
|
150
|
-
position: absolute;
|
151
|
-
top:450px;
|
152
|
-
left:10px;
|
153
|
-
color: #f79b9b;
|
154
|
-
font-size: 50px;
|
155
|
-
font-weight: 900;
|
156
|
-
|
157
|
-
}
|
158
|
-
|
159
|
-
.top-left:hover{
|
160
|
-
color: #f79b9b;
|
161
|
-
}
|
162
|
-
|
163
|
-
.bottom-right {
|
164
|
-
|
165
|
-
}
|
166
|
-
.bottom_img{
|
167
|
-
width: 300px;
|
168
|
-
height: 300px;
|
169
|
-
}
|
170
|
-
.main_header{
|
171
|
-
font-weight: 800;
|
172
|
-
font-size:40px;
|
173
|
-
color: black;
|
174
|
-
}
|
175
|
-
|
176
|
-
a:hover{
|
177
|
-
text-decoration-line: none;
|
178
|
-
|
179
|
-
}
|
180
|
-
|
181
|
-
.u-dimension-2 {
|
182
|
-
box-shadow: 0 0 0 1px rgba(67,41,163,.1), 0 1px 8px 0 rgba(67,41,163,.1);
|
183
|
-
}
|
184
|
-
|
185
|
-
.form {
|
213
|
+
.form {
|
186
214
|
margin: 0 auto;
|
187
215
|
width: 470px;
|
188
216
|
background-color: white;
|
@@ -195,17 +223,41 @@ a:hover{
|
|
195
223
|
}
|
196
224
|
|
197
225
|
.err {
|
198
|
-
|
199
|
-
|
226
|
+
color: red;
|
227
|
+
font-size: 14px;
|
200
228
|
}
|
201
229
|
|
230
|
+
.error {
|
231
|
+
color: red;
|
232
|
+
font-size: 13px;
|
233
|
+
}
|
234
|
+
|
235
|
+
|
202
236
|
#flash_alert{
|
203
|
-
|
204
|
-
|
237
|
+
color: red;
|
238
|
+
font-size: 14px;
|
205
239
|
}
|
206
240
|
|
241
|
+
/*label{
|
242
|
+
margin-bottom: 5px;
|
243
|
+
}*/
|
244
|
+
|
207
245
|
|
208
246
|
</style>
|
209
247
|
|
210
248
|
|
211
249
|
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
@@ -6,15 +6,15 @@
|
|
6
6
|
<div class="container">
|
7
7
|
<div>
|
8
8
|
<h2>Users</h2>
|
9
|
-
<%= link_to "
|
9
|
+
<%= link_to "Add user", new_user_path, :class => 'btn btn-sm btn-success' %>
|
10
10
|
</div><br>
|
11
11
|
<table class="table">
|
12
12
|
<thead>
|
13
13
|
<tr>
|
14
14
|
<th>Id</th>
|
15
|
-
<th>
|
16
|
-
<th>
|
17
|
-
<th>
|
15
|
+
<th>Name</th>
|
16
|
+
<th>Email</th>
|
17
|
+
<th>Mobile</th>
|
18
18
|
<th>Actions</th>
|
19
19
|
</tr>
|
20
20
|
</thead>
|
@@ -1,215 +1,216 @@
|
|
1
|
-
<script src="https://
|
1
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js">
|
2
|
+
|
3
|
+
</script>
|
2
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>
|
3
7
|
|
4
8
|
|
5
|
-
<body >
|
6
|
-
<div class="container" >
|
7
|
-
<div class="form-horizontal no-border form u-dimension-2"
|
8
|
-
style ="margin-top: 100px; width: 450px;"align="center" >
|
9
|
-
|
10
|
-
|
11
|
-
<%= form_for @user , :url => {:action => "create", :controller => "users"} do |f| %>
|
12
|
-
|
13
|
-
<h2 align="center">User Form </h2>
|
14
|
-
|
15
|
-
|
16
|
-
<div class="form-group">
|
17
|
-
<div class="col-sm-12">
|
18
|
-
<%= f.label :name %>
|
19
|
-
<span class="err"><%= @user.errors[:name].join('. ') %></span><br/>
|
20
|
-
<%= f.text_field :name, autocomplete: "current-name",class: 'form-control'%>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<div class="form-group">
|
25
|
-
<div class="col-sm-12">
|
26
|
-
<%= f.label :email %>
|
27
|
-
<span class="err"><%= @user.errors[:email].join('. ') %></span><br/>
|
28
|
-
<%= f.email_field :email, autocomplete: "email",class: 'form-control'%>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
|
32
|
-
<div class="form-group">
|
33
|
-
<div class="col-sm-12">
|
34
|
-
<%= f.label :mobile %>
|
35
|
-
<span class="err"><%= @user.errors[:mobile].join('. ') %></span><br/>
|
36
|
-
<%= f.text_field :mobile, autocomplete: "current-name",class: 'form-control'%>
|
37
|
-
</div>
|
38
|
-
</div>
|
39
|
-
|
40
|
-
<div class="form-group">
|
41
|
-
<div class="col-sm-12">
|
42
|
-
<%= f.submit "Submit", class: 'submitBtn btn btn-block btn-success btn modal_btn', id: 'modal-submit' %>
|
43
|
-
</div>
|
44
|
-
</div>
|
45
|
-
<% end %>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
</div>
|
49
|
-
</body>
|
50
|
-
|
51
9
|
<script type="text/javascript">
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
+
minlength: 10
|
21
|
+
}
|
22
|
+
},
|
23
|
+
// Specify validation error messages
|
24
|
+
messages: {
|
25
|
+
name: "Please enter your firstname",
|
26
|
+
mobile: {
|
27
|
+
required: "Please Enter mobile number",
|
28
|
+
minlength: "Your Mobile must be at least 10 characters long"
|
29
|
+
},
|
30
|
+
email: "Please enter a valid email address"
|
31
|
+
},
|
32
|
+
// in the "action" attribute of the form when valid
|
33
|
+
submitHandler: function(form) {
|
34
|
+
form.submit();
|
35
|
+
}
|
36
|
+
});
|
37
|
+
});
|
73
38
|
</script>
|
39
|
+
<body >
|
40
|
+
<div class="container" >
|
41
|
+
<div class="form-horizontal no-border form u-dimension-2"
|
42
|
+
style ="margin-top: 100px; width: 450px;"align="center" >
|
43
|
+
<%= form_for @user, :user => {}, :html => { :name =>"myForm"} do |f| %>
|
44
|
+
<h2 align="center">User Form </h2>
|
45
|
+
|
46
|
+
<div class="form-group">
|
47
|
+
<div class="col-sm-12">
|
48
|
+
<%= f.label :name %>
|
49
|
+
<%= f.text_field :name, autocomplete: "current-name",name: "name", class: 'form-control'%>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<div class="form-group">
|
54
|
+
<div class="col-sm-12">
|
55
|
+
<%= f.label :email %>
|
56
|
+
<%= f.email_field :email, name: "email", autocomplete: "email",class: 'form-control'%>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="form-group">
|
61
|
+
<div class="col-sm-12">
|
62
|
+
<%= f.label :mobile %>
|
63
|
+
<%= f.text_field :mobile,name: "mobile", autocomplete: "current-name",class: 'form-control'%>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div class="form-group">
|
68
|
+
<div class="col-sm-12">
|
69
|
+
<%= f.submit "Submit", class: 'submitBtn btn btn-block btn-success btn modal_btn', id: 'modal-submit' %>
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
<% end %>
|
73
|
+
|
74
|
+
<div>
|
75
|
+
<%= link_to "Back", users_path, class: "btn btn-sm btn-info"%>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</body>
|
74
80
|
|
75
81
|
|
76
82
|
<style type="text/css">
|
77
83
|
.form-group{
|
78
|
-
|
84
|
+
width:356px;
|
85
|
+
margin-bottom: 30px;
|
79
86
|
}
|
80
87
|
|
81
88
|
.form{
|
82
|
-
|
83
|
-
|
84
|
-
padding-top: 30px;
|
85
|
-
padding-bottom: 50px;
|
89
|
+
padding-top: 30px;
|
90
|
+
padding-bottom: 50px;
|
86
91
|
}
|
87
92
|
.col-sm-12{
|
88
|
-
|
89
|
-
|
93
|
+
padding-left: 0px;
|
94
|
+
padding-right: 0px;
|
90
95
|
}
|
91
96
|
|
92
|
-
|
93
|
-
|
94
97
|
#user_remember_me{
|
95
|
-
|
98
|
+
margin-right:0px;
|
96
99
|
}
|
97
100
|
.forgot_pwd{
|
98
|
-
|
101
|
+
padding-left: 90px;
|
99
102
|
}
|
100
103
|
|
101
104
|
a:hover{
|
102
105
|
text-decoration-line: none;
|
103
|
-
|
104
106
|
}
|
105
107
|
|
106
108
|
#flash_alert{
|
107
|
-
|
109
|
+
color: red;
|
108
110
|
}
|
109
111
|
|
112
|
+
#form_email{
|
113
|
+
margin-left: 23px;
|
114
|
+
}
|
110
115
|
|
111
|
-
#form_email{
|
112
|
-
margin-left: 23px;
|
113
|
-
}
|
114
116
|
|
115
117
|
|
118
|
+
#sign_in_from{
|
119
|
+
margin-left: 400px;
|
120
|
+
}
|
116
121
|
|
117
|
-
|
118
|
-
|
119
|
-
}
|
122
|
+
/*.new_user{
|
123
|
+
margin-top: 100px;
|
124
|
+
}*/
|
120
125
|
|
121
|
-
|
122
|
-
|
123
|
-
|
126
|
+
.form1 {
|
127
|
+
margin: 0 auto;
|
128
|
+
width: 470px;
|
129
|
+
background-color: white;
|
130
|
+
padding-left: 0px;
|
131
|
+
}
|
124
132
|
|
125
|
-
.
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
}
|
133
|
+
.form label {
|
134
|
+
display: inline-block;
|
135
|
+
text-align: right;
|
136
|
+
float: left;
|
137
|
+
|
138
|
+
}
|
131
139
|
|
132
|
-
.
|
133
|
-
|
134
|
-
|
135
|
-
float: left;
|
136
|
-
|
137
|
-
}
|
140
|
+
.modal_form{
|
141
|
+
margin-top: 0px;
|
142
|
+
}
|
138
143
|
|
139
|
-
.
|
140
|
-
|
141
|
-
|
144
|
+
.homepage_dish{
|
145
|
+
height: 100%;
|
146
|
+
width: 50%;
|
147
|
+
position:fixed;
|
148
|
+
}
|
149
|
+
|
150
|
+
.login{
|
151
|
+
padding-right: 20px;
|
152
|
+
color:#0066ff;
|
153
|
+
font-size: 20.3px;
|
154
|
+
line-height: 1.44359;
|
155
|
+
border: 0px;
|
156
|
+
font-weight:700;
|
142
157
|
|
143
|
-
.homepage_dish{
|
144
|
-
height: 100%;
|
145
|
-
width: 50%;
|
146
|
-
position:fixed;
|
147
|
-
}
|
148
|
-
|
149
|
-
.login{
|
150
|
-
padding-right: 20px;
|
151
|
-
color:#0066ff;
|
152
|
-
font-size: 20.3px;
|
153
|
-
line-height: 1.44359;
|
154
|
-
border: 0px;
|
155
|
-
font-weight:700;
|
156
158
|
|
159
|
+
}
|
157
160
|
|
158
|
-
|
161
|
+
.login a:hover{
|
159
162
|
|
160
|
-
|
163
|
+
}
|
161
164
|
|
162
|
-
|
165
|
+
.signup{
|
166
|
+
padding-right: 100px;
|
167
|
+
color:#0066ff;
|
168
|
+
|
169
|
+
font-size: 20.3px;
|
170
|
+
line-height: 1.44359;
|
171
|
+
border: 0px;
|
172
|
+
font-weight:700;
|
163
173
|
|
164
|
-
.signup{
|
165
|
-
padding-right: 100px;
|
166
|
-
color:#0066ff;
|
167
|
-
|
168
|
-
font-size: 20.3px;
|
169
|
-
line-height: 1.44359;
|
170
|
-
border: 0px;
|
171
|
-
font-weight:700;
|
172
174
|
|
175
|
+
}
|
173
176
|
|
174
|
-
|
177
|
+
.top-left {
|
178
|
+
position: absolute;
|
179
|
+
top:450px;
|
180
|
+
left:10px;
|
181
|
+
color: #f79b9b;
|
182
|
+
font-size: 50px;
|
183
|
+
font-weight: 900;
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
.top-left:hover{
|
188
|
+
color: #f79b9b;
|
189
|
+
}
|
175
190
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
}
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
}
|
197
|
-
|
198
|
-
|
199
|
-
font-size:40px;
|
200
|
-
color: black;
|
201
|
-
}
|
202
|
-
|
203
|
-
a:hover{
|
204
|
-
text-decoration-line: none;
|
205
|
-
|
206
|
-
}
|
207
|
-
|
208
|
-
.u-dimension-2 {
|
209
|
-
box-shadow: 0 0 0 1px rgba(67,41,163,.1), 0 1px 8px 0 rgba(67,41,163,.1);
|
210
|
-
}
|
211
|
-
|
212
|
-
.form {
|
191
|
+
.bottom-right {
|
192
|
+
|
193
|
+
}
|
194
|
+
.bottom_img{
|
195
|
+
width: 300px;
|
196
|
+
height: 300px;
|
197
|
+
}
|
198
|
+
.main_header{
|
199
|
+
font-weight: 800;
|
200
|
+
font-size:40px;
|
201
|
+
color: black;
|
202
|
+
}
|
203
|
+
|
204
|
+
a:hover{
|
205
|
+
text-decoration-line: none;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
.u-dimension-2 {
|
210
|
+
box-shadow: 0 0 0 1px rgba(67,41,163,.1), 0 1px 8px 0 rgba(67,41,163,.1);
|
211
|
+
}
|
212
|
+
|
213
|
+
.form {
|
213
214
|
margin: 0 auto;
|
214
215
|
width: 470px;
|
215
216
|
background-color: white;
|
@@ -222,17 +223,41 @@ a:hover{
|
|
222
223
|
}
|
223
224
|
|
224
225
|
.err {
|
225
|
-
|
226
|
-
|
226
|
+
color: red;
|
227
|
+
font-size: 14px;
|
227
228
|
}
|
228
229
|
|
230
|
+
.error {
|
231
|
+
color: red;
|
232
|
+
font-size: 13px;
|
233
|
+
}
|
234
|
+
|
235
|
+
|
229
236
|
#flash_alert{
|
230
|
-
|
231
|
-
|
237
|
+
color: red;
|
238
|
+
font-size: 14px;
|
232
239
|
}
|
233
240
|
|
241
|
+
/*label{
|
242
|
+
margin-bottom: 5px;
|
243
|
+
}*/
|
244
|
+
|
234
245
|
|
235
246
|
</style>
|
236
247
|
|
237
248
|
|
238
249
|
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
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:
|
4
|
+
version: 0.2.1
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|