I have this weird problem where error_messages_for isn’t working.
I have a model group which has to validates constraints…
class Group < ActiveRecord::Base
#directionality points to the user model
#this table contains the foreign key
validates_uniqueness_of :name validates_presence_of :name
In the controller I have a method which persists this group
if( group.save )
logger.debug( “group save successful”)
flash[:notice] = ‘Created group ’ + group.name + ’ successfully’
logger.debug( “group save unsuccessful”)
flash[:notice] = ‘Could not save group’
in the manage_friends.rhtml i have the code…
<%= start_form_tag :controller=> “profile”, :action=> “create_group” %>
<%= text_field “group”, “name”, :size => 30 %>
<%= start_form_tag :controller=> “profile”, :action=>
but no text gets generated from the <%= error_messages_for call.
I also tried the error_messages with (:group)
Any ideas anyone!?!?!