On 27 March 2010 12:33, Rahul Mehta <[email protected]> wrote:
> Hi all,
>
> I'm new here. However, I'm so happy because I got Ruby on Rails to
>  work on my host. Now there's just a problem with displaying
> validation error message ,
>
> in my view i have used the form_tag code is as follow
>
> <% form_tag 'create', :multipart => true do %>
>
> <%= error_messages_for :content_masters %>
>  <p>
>    <%= label_tag :title %>
>    <%= text_field_tag :title %>
>  </p>
>
> content_masters is my controller name ..
>
> in my model m using
>
>  validates_presence_of(:title, :message => "message")
>
> the validation message is not coming ..

Have a look at the rails guides at http://guides.rubyonrails.org/.
The getting started guide shows how to use form_for, which is better
than form_for in most cases, and includes display of error messages.
Also the guide on debugging shows ways of debugging your app if it is
not performing as expected.  The other guides should be read also.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to