how to get the message from validates_presence_of

In your view you need to include the error_messages_for method.
This takes a string argument that is the name of an instance variable.

in contoller

@thing.save #=> fails due to errors

in view

error_messages_for “thing”

You can have as many calls to error_messages_for as you want in one view, for as many instance variables as you have.

The docs as www.rubyonrails.org/docs have more in depth explainations.

http://api.rubyonrails.org/classes/ActionView/Helpers/ActiveRecordHelper.html#M000460