Error_messages_for not displaying validation errors

Hi all,

I’ve been searching the web and the list archives for help on this and
I’ve
found some tips, but I’ve been racking my brain on this for hours.

I have a Model, View, and Controller that are handling the uploading of
a
file to my server. I want to make sure that the description is set and
that
a file is selected to be uploaded. I have set validates_presence_of for
both
of these fields in my model and added error_messages_for in my view.
However, the errors are not being displayed. But, if I output @
myobject.errors, I see that the errors are in fact being logged, just
not
displayed via error_messages_for. Any help that you can offer is
appreciated.

Here are links to my code:

Many thanks,
Ryan

Change @content in your controller code to @user_file

Hi Craig,

Thanks for the tip. That worked like a charm!

Best,
Ryan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs