I’m using a model that belongs to 2 other models. When I try to create it, I manage to get both ids, but the content itself isn’t stored in database
def create
@person = Person.find(current_person)
@message = Message.create(:group => Group.find(params[:group_id]), :person => Person.find(current_person))
if @message.save
redirect_to(:back)
else
redirect_to(:back)
end
end
<% form_for(:message, :url => messages_path(:person_id => current_person.id, :group_id => @group.id)) do |f| %>
<%= f.text_area :content %>
<%= f.submit "Submit" %>
<%end %>
Also, content is set as text in database and I’m using PostgreSQL.
1 Answer