473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.
Mar 21 '08 #1
1 2541
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)
Mar 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Eric O. Angell | last post by:
Say I have class Header: def __init__(self): self.foo = 0 # ... more fields and I have some commandline options that can specify better values for things in the header, such as foo. If I try...
46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
0
by: Adisorn Ratanakovit | last post by:
When you set up a full-text catalog in SQL Server and you set up the population schedule, a job gets created and scheduled under SQL Server Agent. The problem I encountered recently is when I...
0
by: Denise | last post by:
Hi I have set up a full text index on one of my database tables and created a catalog. Then I started a full population on my catalog and got a message "Population of full text index started...
2
by: Kenny G | last post by:
Currently I have four datetime fields: DteTimeNotified DteTimeStarted DteTimeCompleted DteTimeReported Each of these fields contain the input mask 99/99/00" "00:00;0 This gives me a short...
1
by: Jerry | last post by:
Prewarning: I'm a newbie at VB. I just got done reading _Beginning Visual Basic 2005_ (wrox) and I'm trying to put some of the things in there to use. I have a form where I can page through the...
2
by: Bilal | last post by:
Hello, I'm stuck on this problem for quite some time and hope somebody would be able to guide me. Basically, I need to populate a large number of "template" XML files which have all...
14
by: neonman14 | last post by:
Hello I am in Intro to Java Programming and I am having problems with assignment. The Homework assignment is called Population. Population Write a program that will predict the size of a...
1
by: tg | last post by:
http://img522.imageshack.us/img522/8647/scan10005ci7.jpg As a percentage of world inhabitants, the white population will plummet to a single digit (9.76%) by 2060 from a high-water mark of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.