Displaying 1 result from an estimated 1 matches for "message_content".
2007 Jan 21
1
Form question
...rb
class Message < ActiveRecord::Base
belongs_to :user
validates_presence_of :user_id
end
and the second is user.rb
class User < ActiveRecord::Base
has_many :messages
end
Then I also have a form which will let me specify which User a Message
belongs to.
<p><label for="message_content">Content</label><br/>
<%= text_field ''message'', ''content'' %></p>
<p>
<label for="message_user_id">User</label><br/>
<%= select("user", "id", User.find(:all).collect {|u| [u.u...