# Validate not working?

**URL:** <https://www.ruby-forum.com/t/validate-not-working/87708>\
**Category:** Rails\
**Created:** [March 5, 2007, 1:06pm UTC](https://www.ruby-forum.com/t/validate-not-working/87708 "2007-03-05T13:06:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [March 5, 2007, 1:06pm UTC](https://www.ruby-forum.com/t/validate-not-working/87708/1 "2007-03-05T13:06:28Z")

</div>

Hello,

My validate is not working, I don’t know why, it just stopped working?

Model:

class User \< ActiveRecord::Base  
validates\_presence\_of :nickname, :email, :password  
validates\_confirmation\_of :password  
validates\_length\_of :nickname, :password, :within =\> 5…40  
validates\_uniqueness\_of :nickname, :email  
validates\_format\_of :email, :with =\>  
/^([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$/i  
end

Controller:

def signup  
if request.post?  
user = User.new(params[:user])  
if user.save  
flash[:notice] = “Signup successful”  
redirect\_to :action =\> ‘login’  
end  
end  
end

View:

\<%= start\_form\_tag :action=\> “signup” %\>  
\<%= error\_messages\_for ‘user’ %\>

Desired nickname:\<%= text\_field "user", "nickname", :size =\> 20 %\>

```
<dt><label for="user_login">Email:</label></dt>
<dd><%= text_field "user", "email", :size => 30 %></dd>

<dt><label for="user_password">Choose password:</label></dt>
<dd><%= password_field "user", "password", :size => 30 %></dd>

<dt><label for="user_password_confirmation">Confirm

```

password:

\<%= password\_field “user”, “password\_confirmation”, :size =\> 30  
%\>

```
<dt></dt>
<dd><input type="submit" value="Signup &#187;" class="primary"

```

/\>

\<%= end\_form\_tag %\>

Can anyone see anything wrong??

---

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [March 5, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/validate-not-working/87708/2 "2007-03-05T13:43:27Z")

</div>

\*Someone told me its old way to use

@user = ‘something’

well, I don’t know where he got this information from, this @ didn’t get  
my validate to work, seems everything you put @ beside it will be giving  
access to it from your views or else only in your controller.
