Hi Lasse,
Thanks for your concern..
if i want to validate title than
<p>
<%= label_tag :title %>
<%= text_field_tag :title %>
</p>
then.............................
<%= error_messages_for @title %>
<%= error_messages_for :title %>
i have tried both the syntax but not working
do u have any idea ..
thanks
rahul
On Mar 27, 5:42 pm, Lasse Bunk <[email protected]> wrote:
> Hi Rahul,
>
> The symbol (:content_masters) in error_messages_for should be the name of a
> variable, so if you wanted to display error messages for at variable called
> @user, you'd call it like this:
>
> <%= error_messages_for 'user' %>
>
> Please also
> seehttp://api.rubyonrails.org/classes/ActionView/Helpers/ActiveRecordHel...
> .
>
> /Lasse
>
> 2010/3/27 Rahul Mehta <[email protected]>
>
> > 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 ..
>
> > I hope you want to help me.
>
> > Thanks
>
> > --
> > 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]<rubyonrails-talk%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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.