nyros_form2 0.2.2 → 0.2.3
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: 827203ba57cd6aaa195c5e66782ea58028cf26e0eefc87b90b1f2ee045ae33e9
|
4
|
+
data.tar.gz: fa8d4f8ab8672014d0f18ebcc2190a013fc9cafbe5426ad0bf40525e9b6d7736
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2023ede670c53cface1d97914c51b5c79abb69b415781d65c57855023defe4db46c87253c96cc2b80321e431a7995ab2f7eeef0be9a1e2b44bbf2009ee036598
|
7
|
+
data.tar.gz: 96609a424827d758ce329771b6d6b0e05a69c075d83ced6b9b49374355acf9eb91afa7bfe2b746ecc52e472748643f901e8c9542d674d5d72f04552924a11dde
|
@@ -7,23 +7,24 @@ module NyrosForm2
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def new
|
10
|
-
|
10
|
+
@user = User.new
|
11
11
|
end
|
12
12
|
|
13
13
|
def create
|
14
|
-
|
15
14
|
@user = User.new(user_params)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
respond_to do |format|
|
16
|
+
if @user.save
|
17
|
+
format.html { redirect_to users_path, notice: 'Contact was successfully created.' }
|
18
|
+
format.json { render json: @user, status: :created, location: @user }
|
19
|
+
else
|
20
|
+
format.html { render action: "new" }
|
21
|
+
format.json { render json: @user.errors, status: :unprocessable_entity }
|
22
|
+
end
|
23
|
+
end
|
22
24
|
end
|
23
25
|
|
24
26
|
|
25
27
|
|
26
|
-
|
27
28
|
def show
|
28
29
|
@user = User.find(params[:id])
|
29
30
|
end
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module NyrosForm2
|
2
2
|
class User < ApplicationRecord
|
3
|
-
|
4
|
-
# with: URI::MailTo::EMAIL_REGEXP,
|
5
|
-
# message: '*Please Enter Your Email'
|
6
|
-
# }
|
3
|
+
validates :email, :uniqueness => true
|
7
4
|
# validates_presence_of :name, message: "*Please Enter Your Name"
|
8
5
|
# # svalidates_presence_of :mobile, message: "*Please Enter Your Mobile"
|
9
6
|
# validates_format_of :mobile, :with => /\d[0-9]\)*\z/ , :message => "*Please Enter a Valid Mobile Number"
|
data/lib/nyros_form2/version.rb
CHANGED