Connecting Tech Pros Worldwide Help | Site Map

HABTM population from text fields

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 21st, 2008, 01:01 PM
Newbie
 
Join Date: Mar 2008
Posts: 2
Default HABTM population from text fields

Hi. I'm having problems wrapping my head around the use of HABTM. I just
haven't found a good enough reference for dealing with HABTM-linked
models, and my business logic is full of them.

In this case, I have a model Initative and a model called Reference for
associating one or more reference documents to an Initative. Any
Reference document could also be referenced by any number of Initatives.
So Initative has objects/columns Initative_ID and also Ref_Num:String.
I have declared HABTM in each model.

I need a straighforward way for a user to enter associated documents
from the context of an Initative record form. I would think that an
editable dropdown would be one way, which would allow the user to select
a Reference already in the database or allow them to enter a new one. I
also would settle for some version of a text field or text area with a
"Add Reference" button. I would even consider a popup form with some
version of these controls.

Being that all of the HABTM references I have seen seem to be really
checkbox-focused, I haven't really seen anything that gives me a good
idea how to go about this. I have done similar things in Access and
Notes, but can't quite figure out the HABTM syntax well enough to do it
in Rails.
Reply
  #2  
Old March 21st, 2008, 09:04 PM
Newbie
 
Join Date: Mar 2008
Posts: 2
Default

Slight typo in my original post.

What I meant to write is that my Reference model has fields Reference_ID (:int) and Ref_Num(:string)
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.