nyros_form2 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34846da057696e9bfaf90dcaba9beadad726f46f549831cf8b16d029dd2f5479
4
- data.tar.gz: c8c47b3c4972bafea91ea2406f906b147a8955a3925d6650f2c0923fc6551fc5
3
+ metadata.gz: 827203ba57cd6aaa195c5e66782ea58028cf26e0eefc87b90b1f2ee045ae33e9
4
+ data.tar.gz: fa8d4f8ab8672014d0f18ebcc2190a013fc9cafbe5426ad0bf40525e9b6d7736
5
5
  SHA512:
6
- metadata.gz: 6ac77eb97931ab3f25d84d459f3fb08878245f77c1a020fd19ad88b882ce14feb07de1d8c132c1f86689bd1233a74deaa5764e4f658931c993cbff46df0343ab
7
- data.tar.gz: 79b886769e63ed00adeb6e756c4525bf116a781eadd0b56f37071ab5fca4cc012778d866d69b60dcd25c666126157901a7ca647182bfbf67a7bb4dfe79454897
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
- @user = User.new
10
+ @user = User.new
11
11
  end
12
12
 
13
13
  def create
14
-
15
14
  @user = User.new(user_params)
16
-
17
- if @user.save
18
- redirect_to users_path
19
- else
20
- render :new
21
- end
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
- # validates :email,uniqueness: true, format: {
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"
@@ -57,6 +57,7 @@
57
57
  <div class="form-group">
58
58
  <div class="col-sm-12">
59
59
  <%= f.label :email %>
60
+ <span class="err"><%= @user.errors[:email].join('. ') %></span><br/>
60
61
  <%= f.email_field :email, name: "email", autocomplete: "email",class: 'form-control'%>
61
62
  </div>
62
63
  </div>
@@ -1,3 +1,3 @@
1
1
  module NyrosForm2
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nyros_form2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - raju rekadi