similar to: Grouped selection lists

Displaying 20 results from an estimated 40000 matches similar to: "Grouped selection lists"

2006 Apr 13
7
Whats the best way to achieve this?
employees HABTM projects, projects HABTM employees. I am doing a permissions page for a selected project. I know that I can get all of the employees in the system (@employee.find(:all)) or get all the employees for the selected project. What i''m trying to do is get a list of all the employees in the system and have a check box that states if they are associated with the current
2006 Jan 25
2
Update join_table attributes
I have two ActiveRecord classes that point at each other with a "has_and_belongs_to_many" (habtm) relationship using a join table. The join table has an a few additional columns besides the _id columns. For those of you with the Agile Web Dev w/ Rails book, it''s exactly the same setup as the articles<->articles_users<->users example on p240. The habtm
2006 Mar 22
2
habtm vs. has_many/belongs_to
In AWDWR David says (pg 232), "When a Join Wants to Be a Model: While a many-to-many relation with attributes can often seem like the obvious choice, it?s often a mirage for a missing domain model. When it is, it can be advantageous to convert this relationship into a real model and decorate it with a richer set of behavior. This lets you accompany the data with methods. As an example,
2006 Apr 20
2
Additional Fields in a Join Table
Hi, I am creating an order management web application, and have run into an issue over join tables. I am reading Agile Web Development and it says that I can put additional fields within my join tables, and they give the example of a date field. I want to know if it is possible to do the following: I have an orders table with the order information as well as an orders_items table and an
2011 May 18
1
Grouped bar plot
Hi, I am trying to produce a grouped bar plot from a data.frame and I'm having difficulties figuring out how to do so. My data is 500 rows by 4 columns and basically looks like so: > head(x) V1 V2 V3 V4 1 XOM 0.2317915 0.1610068 1.6941637 2 AAPL 0.6735488 0.7433611 0.1594102 3 GE 1.2554160 0.9237384 1.6767711 4 IBM 1.6296938 0.3730387 0.5858115 5 CVX
2005 Nov 30
2
Missing scaffold features
Hello everyone, First off, I''m trying to generate a discussion here, not provoke an argument or get people upset. Please bear this in mind if/as you read on... To my mind, there''s 3 missing features from scaffolds that would make them a whole lot more useful. These are: - auto-generation of a drop-down list for inputting/updating has_many/belongs_to relationships between
2006 Apr 29
5
HABTM - how to insert join row when associated rows exist
I have successfully used HABTM to create a many-to-one-to-many set of rows in one step. Now, if two objects I want to associate already exist, how do I create the join row? The Agile book mentions the ''push_with_attributes'' method. The text says this method is useful for adding additional attributes to the join row (in the example a ''read_at'' timestamp). I
2006 Feb 22
0
Rewriting attribute accessors?
I''m new to Rails and so was wondering if the following strategy is a good idea. Background: I''m writing a eCommerce application which has a Product model and an Option model, they are setup with a has_and_belongs_to_many relationship. The Product model features the ''base'' attributes of the product and then the shopkeeper *can* add one or more Options that
2005 Dec 29
4
Images in Agile Web Development with Rails
Hi, I am working through Agile Web Development with Rails and I am at pg 69 second last paragraph says "put some images in the public/images directory......" how do you code the link that is stored in the data base I have tried http:public/images/name .jpg with no avail I have tried the fully qualified address http://home/../../../../name.jpg also with no luck. How should I code this?
2006 Feb 09
2
select options for HABTM?
I''ve looked through the docs and the wiki and can''t figure out how to go about generating select options and the update function for an item that has a HABTM relationship. I have a ''parks'' table and the park model has a HABTM to the ''states'' table. On the park edit page, I''d like a multiple select box to appear with all states show,
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
2006 Apr 10
1
Add''l filtering on HABTM
I have a table "keywords" with a HABTM relationship with "files" in a legacy MySQL db. I can find all of the files associated with a keyword in Rails. These files can be on any of 4 volumes. However, users can have restrictions on which volumes they have access to, so after returning the file list, I need to filter it against an string array of allowable volumes for that
2006 Jun 20
2
habtm, multi select, and validation
Greetings - I''m trying to find the most efficient, "Rails" way to solve the following problem. It''s in two parts, but I think the solution is somewhat related: I have Recipe and Category model related by HABTM. I would like to 1.) Validate the *number* of categories associated with a recipe, say a minimum of 1 and a max of 3. (So validates_associated will not
2006 Jun 04
1
Re:Re:Two Announcements
I agree the presentation needs work haha. That''s something I really haven''t put a lot of thought into yet. I''m hoping to start polishing it up after I get the first half edited and cleaned up text-wise. Since it seems everyone is interested in it, I can definitely post a summary and TOC; I had one up and then when I launched the new site I didn''t put it back
2006 Nov 04
0
Model.delete_all vs Model.destroy_all in a habtm
Hi there I have an habtm association between 2 Models. I regularly have to truncate the table on one side of the relationship and repopulate the table with a fresh csv file. I notice that f I do Model.delete_all, none of the records in my habtm join table get deleted, whereas if I use destroy_all they do. However, the overhead of using destroy_all is too great. For the amount of records I have
2006 Jun 30
2
how to HABTM with STI ??
Hello all This is my first post so excuse the basic question. (and any repeats I just got an email saying this post was too big so I have re-submitted a smaller version) I was following the thread on http://lists.rubyonrails.org/pipermail/rails/2006-May/038988.html regarding the STI on HABTM for RoR. I have a very similar problem and was hoping for some help. I have the
2006 May 24
2
"Stack Level Too Deep" issue in HABTM Unit / Functional Test
Hello guys. I was able to figure out that my "stack level too deep" error I was getting with my HABTM destroy method was the result of a bug in rails 1.0. I upgraded to 1.1.2 and now the views and any console-run commands for destroying AR objects linked together via HABTM work just fine. I have HABTM setup between stories and submissions. The issue is that the destroy methods in
2006 May 09
4
Agile Web Development with Rails
Hi, I''m new to Ruby, Rails and MySQL... Before Dropping my database, I went back to a previous Grant problem. On page 54, there are three create database commands...these all worked fine for me. I then tried the following Grant command: Grant all on depot_development.* to ''dave''@''localhost''; I got back the following error message: Error 1133 (42000):
2006 Mar 26
3
Making a custom selection form - newbie
Hello all, I''ve been working with Ruby on Rails for a few weeks now. It''s difficult for me because I don''t have much experience with Ruby, Rails, MySQL, or any other web-languages. But I''m trudging on and learning a lot. I''ve been working on a web application for my dad''s website; it''s a simple content manager for
2006 Feb 23
1
Pretty HABTM check boxes
I''m 100% positive this has come up multiple times before. I just can''t find it for some reason. I''ve got a HABTM relationship, we''ll just say Item HABTM categories. When I edit an Item via a form, I''d like there to be check boxes for all the categories, and they''ll obviously be checked if an Item has a relationship with a particular