Ruby on Rails Wednesday, July 25, 2012

Manoj,

Open up the console (rails c), and then create a new User (or whatever model you want) like this:

u = User.new

Check if this user is valid:

u.valid?

This should result in false! if NOT, then you don't' have any errors. Then you have to look at you validation lines in the model...

If it is false then try:

u.errors
u.errors.full_messages

this SHOULD give you an array of error messages. If not, there's something wrong.

Now go back to your view and insert

<p>ERRORS: <%= @object.errors.full_messages %> !!! %></p>

into your view. Of course the @object must match the one you are making the form for.

Tell me what you see then.

Cheers
ace






On Wednesday, July 25, 2012 12:30:14 AM UTC-4, Ruby-Forum.com User wrote:

Ace S. wrote in post #1069974:
> Hi manoj,
>
> I am replying to a message that you posted on the ruby-forum but didn't
> show up in google groups.
>
> Anyway, did you put
>
> gem "dynamic_form"
>
>
>
> in your Gemfile?
> And then after that, run 'bundle install' ?
> Please do so and try again.
>
> cheers
> ace

Hi ace,
        yes i did like that you told,  included gem "dynamic_form" in
gemfile and bundle install is done, but now also its not working. What
to do next? help me.

Regards,
manoj

--
Posted via http://www.ruby-forum.com/.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/jDkmszj8oKoJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment