Error_messages_for not displaying validation errors

Hi all,

I’ve been searching the web and the list archives for help on this and
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
file to my server. I want to make sure that the description is set and
a file is selected to be uploaded. I have set validates_presence_of for
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
displayed via error_messages_for. Any help that you can offer is

Here are links to my code:

Many thanks,

Change @content in your controller code to @user_file

Hi Craig,

Thanks for the tip. That worked like a charm!


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