Displaying 20 results from an estimated 900 matches similar to: "Making a custom selection form - newbie"
2006 Jan 05
3
ActiveRecord setting IDs on auto increment fields
Hi All, I''ve tried to do my searches, but can''t find reference to
this anywhere - My question is about ActiveRecord inserts and IDs. I
have a join table that both the models of the source tables join with
"has_and_belongs_to_many". It seems like ActiveRecord is setting the
"id" field for the join table- This should be an auto_increment and
2006 Feb 20
1
belongs_to, has_one, has_many question (again?)
Hi All,
Probably this has been asked numerous times, I apologize already!
Can somebody point me to a good tutorial on how Rails works with
relations?
I know about database design and normalization, I also know about
programming in general (and OOP for that matter).
Only thing I can say is that I''m following the "Four days on Rails"
tutorial by John McCreesh.
He writes
2006 Mar 24
1
Has and belongs to many ... howto in the view?
I have a project, it has members. I have the data modeled, the
ActiveRecord setup but I''m running into a block as how to accomplish
this in a view. I would like if when the Project is being edited to
present a list of all users, and then have a checkbox beside each
name. Those selected would be a member, those who are not, obviously
would not be. I am, however, not closed to
2006 Mar 31
7
Checkboxes expand to show new options when checked?
I''m writing a simple CMS where every item ("listing") HABTM categories
and subcategories (which themselves belong_to a category). What I''m
trying to do now is create a UI effect for listing creation: when you go
to create a listing, only the possible categories will be shown, but
when you select a category a set of new categories will be displayed
like so:
Lions
2006 Jul 02
2
Problems implementing a N:M table that contains actual data
Hi everyone,
I''m currently finishing the planning phase of a small project I want to
create. I read a bunch of tutorials about ActiveRecord and the
different way to link your "tables" with belongs_to, has_many,
has_and_belong_..., etc... However I''m stillnot sure if what I''m trying
to do will work *well* with ActiveRecord.
So enough talk,
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
I''m working on a simple CMS. The main data type are "listings" a listing
habtm (has_and_belongs_to_many) categories and subcategories.
Subcategories belong_to categories. Subcategories are basically the same
as categories, but they are treated differently in a few situations.
The problem is, I can''t seem to write the view/controller/model code
that allows me to
2006 Apr 07
13
Pop up menus - any ideas?
I''ve got a menu in which I have all of my categories as links. Each
category also has subcategories. I want to set it up so when you mouse
over the category the subcategories will pop up (to the right of the
main list, but that''s just CSS). This is what I have so far:
<% for category in @categories %>
<a href="#"
2009 Feb 23
1
ActiveRecord::AssociationTypeMismatch
I have 2 models:
mop, has_and_belong_to_many :contacts
contact, has_and_belong_to_many :mops
when I save my mop Ii have the users coming in a an array:
["9",10"]
I am doing this to asscociate each one to a mop:
@contacts.each do |contact|
@mop.contacts << contact
end
Contact(#44950470) expected, got String(#20837400)
It is giving me the above error. Any ideas?
2009 Jan 20
4
Shared templates across controllers
Hey all,
Here''s my situation: I have a pair of controllers with associated
models (called Services and Testimonials) that are quite similar.
Because their CRUD behavior is executed via AJAX, the "templates" for
the actions are all short .rjs files. Now, because of the similarity
of the models, most of the templates are exactly the same, with only
the object names changed. That
2005 Oct 15
6
FW: Some queueing disciplines that I wrote.
Dear LATRC and devotees,
I have developed some Linux queueing disciplines. I developed them for
my masters project. You are free to use or distribute my work.
Here is the abstract from my dissertation:-
This is a project to implement a Mice and Elephants queuing discipline
on Linux. My project has three aims. The first aim was to produce a
prototype Mice and Elephants router
2006 Jan 12
4
How do you create a tree strucutre with ActiveRecord
I want to build an application that has the concept of administrative
domains. What I mean by this is that administrators have access to
different data, based on what domains they are a member of. The domain
strucutre is hierarchical. Here is an example:
- MLB
- AL
- East
- Yankees
- Red Sox
...
+ Central
+ West
- NL
+ East
+ Central
+ West
Now
2008 Jun 11
1
[LLVMdev] Variable length condition code for SETCC and SELECT?
B. Scott Michel wrote:
>B. Scott Michel wrote:
>
>
>>It'd be easy to hack PromoteOp to make a pass to determine all operands'
>>promoted value types, take the max, then figure out some way to
>>re-promote them to maximal promoted value type. Except that this is a
>>non-optimal solution requiring PromoteOp to potentially traverse the
>>operand
2015 Jun 15
0
Data scientist for Monitoring the Illegal Killing of Elephants at UNEP in Nairobi, Kenya
The CITES Programme for monitoring the illegal killing of elephants (MIKE) is looking for a Data Scientist based at the UN Environment Programme in Nairobi, Kenya. For more details and to apply, please go to http://tinyurl.com/mikeds-p3. Deadline for applications is 3 July.
Org. Setting and Reporting
The United Nations Environment Programme (UNEP) is the United Nations system's designated
2006 Aug 02
2
many-to-one relationship, do I need a second table?
Ok, to keep things short. Im wondering if I need a secondary
relationship table to handle my many-to-one relationships. Here is an
example of what I''ve written down. For instance say I want to find all
of the people in a given location.
class Location < AR:Base
has_many :people
end
class Person < AR:Base
belongs_to :location
end
My SQL tables look like:
CREATE TABLE
2011 Feb 07
2
Search HABTM relationship in ActiveRecord
Consider the following scenario:
Book has_and_belong_to_many Category.
In other words, a category may have a lot of books, and a book can
have more than one category.
What is the best practice to query all books related to some specified
categories.
For example, if I have following books
"From Java To Ruby" - Category: Java, Ruby
"Ruby Programming" - Category: Ruby
2006 Feb 27
1
wbinfo_group.pl / wbinfo -r not working!
Hello,
I have been using samba to authenticate my squid users to Active
Directory. Because of the amount of users, I would like to set up my
ACL's based on groups, rather than individual user accounts.
I have successfully joined my samba box to our windows domain (2k).
For some reason I had to enter the domain controller name instead of
the domain name when doing so. I am now having issues
2006 Apr 21
11
Phone Numbers in Rails/MySQL
Is there any easy way to make a fancy looking form to take phone
numbers. Something that looks like this:
[ ] - [ ] - [ ] ext: [ ]
Then when you submit it it''s combined into one string in the database.
Optimally it would auto-switch from field-to-field after you fill each
field.
Has anyone seen anything like this in Rails?
Thanks,
Adam
--
Posted via
2006 Jan 30
1
Running Rails Tests in Eclipse Test::Unit GUI
Maybe this is common knowledge, I don''t know. I figured I''d post it,
hopefully it can help some people. If anyone has a better way, please
share.
http://jrhicks.net/120 (not my blog, I''m Mike in the comments
I couldn''t get it to literally run the test in the identical way as
rails does when you type rake. However, I could get it to run an
individual
2006 Apr 15
3
login_engine database migration broken?
I''m trying to install the login_engine. I installed the engine system
and the login_engine, and now I''m trying to migrate the database schema,
as detailed here: http://api.rails-engines.org/login_engine/.
The commands I''ve tried are:
rake engine_migrate ENGINE=login which fails with "Don''t know how to
build task
2006 Jan 15
0
HABTM relationships and retrieving multiple selects in controller
Hello all,
I have a product table and an option table that are connected to one another
via a join table. These two tables both contain has_and_belong_to_many
relationships with each other.
I am trying to setup a page where I will create a product and add in its
options. I have already populated the options table with data to draw
from.
so, to start, here is the method from my controller:
def