similar to: newbie question: Mapping Collections

Displaying 20 results from an estimated 700 matches similar to: "newbie question: Mapping Collections"

2007 Nov 19
2
Help with controller and view
I have the following models class Recipe < ActiveRecord::Base has_many :ingredient_recipes has_many :ingredients, :through => :ingredient_recipes end class IngredientRecipe < ActiveRecord::Base belongs_to :ingredient belongs_to :recipe end class Ingredient < ActiveRecord::Base has_many :ingredient_recipes has_many :recipes, :through => :ingredient_recipes
2006 Nov 14
3
messed-up habtm relationship
Hi, I have a many-to-many relationship between dishes and ingredients class Dish < ActiveRecord::Base has_and_belongs_to_many :ingredients end class Ingredient < ActiveRecord::Base has_and_belongs_to_many :dishes end I have a join table dishes_ingredients now when i access my_dish.ingredients, i get a list of what looks like Ingredient objects, but the but they don''t have
2013 Jan 19
2
Deformulation and R
Dear All, I hope this is not too off-topic. Essentially, I need to know if there is any R package which can help me with a deformulation project. Suppose e.g. that you know from a chemical analysis the fat, mineral, vitamin, energy [and so on] content of a certain food product. You also know the ingredients of this product (e.g. milk, lactose, vegetable oil) and you know the chemical
2007 Aug 01
2
map.resources with habtm
Hi I''m trying to use restful resources with recipes and ingredients I''ve set up the models using scaffold_resource. A recipe can have many ingredients and an ingredient can be in many recipes. I''ve set the relationships up using a through. I now want to display a recipe with a list of ingredients but I''m unsure how to proceed. Should I use nested resources and
2006 Apr 07
3
RJS removing content of div, but not div itself
Hi, I''m creating a list of ingredients on a page. When the user clicks the ''Add Ingredient'' button a record gets added to the db and the ingredient gets added to the page. On the page, each record is represented by a <div> with three <span>s inside. One of the <span>s has a link_to_remote to ''delete'' the ingredient. When the link
2006 Apr 10
2
RJS newbie - need help with iterating / existence test
Greetings! I''m new to Ajax and am trying to get a basic app working as a vehicle for learning it. The app is an extension of the cookbook tutorial. My intent is to be able to add a list of ingredients for a recipe. The page to add ingredients uses Ajax. As ingredients are added to the page they''re displayed in a "green-bar" format like that used in the Depot
2010 Mar 11
4
Call a controller method from a view
Hi, I am trying to call a controller method from my view, but I get an error and I don''t know how to correct it. What i am trying to do: I am in the edit form of the model Product, and products can have many ingredients. So on my edit form there is a text_field where you type the ingredient with a link "Add" which is supposed to add the typed ingredient to the current
2007 Feb 03
2
Boost Sorting with Acts_as_ferret?
Hey guys, Simple question here. I have a single index of recipes, from which I''m looking at the following fields: Name, Ingredient Text, Tags, and Description. The key is, I want to show all the results that come from Name, before I show any of the results from Ingredient Text, Tags, or Description. I tried doing this: acts_as_ferret :fields => { :name =>
2006 Jan 30
6
Looking for better code
Hi, I''ve been programming in RoR for about a week or 2-3, and I like it very much. Now, I have a certain problem that is very complicated, well for me at least :-) I have 3 database tables: recipes ingredients and another one which binds the previous 2 tables together Now, I want to have an input form where you can insert 1 recipe and a certain amount of ingredients, say 5. What do
2006 Jan 23
16
Adding form fields (extending a form) on the fly
Hello, I just can''t seem to find a way to extend a form dynamically in ROR. Say I am writing a recipe website. There is one form to enter the recipe. There is room for N number of ingredients (let''s say a text field for each ingredient name and selection list for the amount). What if the user wants to add more than N ingredients as he types them in? how do I do this without
2009 Apr 16
6
Using Paperclip::Processor and RMagick to sharpen my thumbnails
Hi, I''m brand new to RMagick (and pretty new to Rails for that matter!). Right now, site owners are allowed to upload product and ingredient photos to the website. Everything works great, ingredients are sized down and proportioned correctly...the problem is that the resulting images are so blurry! So I''ve been doing some research and it looks like Paperclip::Processor may be the
2015 Sep 16
2
LLVM linking problem
When I use clang on Windows to compile a program using regular expressions to intermediate code, then run the result through llvm-link and finally try to generate an executable, I get an error. All of these ingredients are necessary; it works if the program doesn't use regular expressions, and it works if I compile it directly instead of going via intermediate code. The use of the exact
2005 Mar 06
2
Recipe Browser 0.4.1
I am please to announce the release of Recipe Browser 0.4.1. This project (and files) can be located at http://rubyforge.org/projects/recipe/. This release brings Recipe Browser up to Rails 0.10, with a handful of bug fixes. Special thanks to E Gard (x2egard) the newest member to the project who also happened to do all the work for this release ;). We would love to hear any questions,
2006 Apr 18
12
Formatting data drawn from a DB
Question for all: Right now i have a Table in a mySQL DB that has a row called Ingredients. When the data is entered into the DB its enter like so from a text area: 1 1/2 lbs. beef top sirloin, thinly sliced 1/3 cup white sugar 1/3 cup rice wine vinegar 2 tablespoons frozen OJ concentrate 1 teaspoon salt 1 tablespoon soy sauce 1 cup long grain rice 2 cups water 1/4 cup cornstarch 2 teaspoons
2010 Mar 08
2
ActiveRecord::ReadOnlyRecord on attributes_update
Hi, I have a ActiveRecord::ReadOnlyRecord error when i update child attributes whereas when i create a new one it works fine. Someone had this error? Best, greg -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2005 Mar 07
2
0.10.1 Upgrade problems
I just did an upgrade to Rails 0.10.1. It seems to have broken my app. I get this error (nothing works): ActionController::RoutingError (No route for path: ""): /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/routing.rb:258:in `recognize!'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.0/lib/dispatcher.rb:32:in `dispatch''
2007 Jun 28
2
CentOS iso for Sparc64 machine
Hi, I have been looking for CentOS for sparc based machines without luck. I tried to use birorrent to download it without luck. I really would appreciate anyone letting me know because I have a Sun Ultra 60 that I would love to install it on. Thanks! -- Dexter Dexter F. Stowers Systems Administrator Unix/Linux/Windows/Mac Clemson University -- Desire is the ingredient that changes the hot
2006 Feb 27
3
Updates on Centos 4
Hi, I have a server that has been running Centos for about a year but I have not checked to see if there have been any changes to update. Has there been any updates or fixes for the update? I have not been in the loop for a while now. Thanks! -- Dexter Desire is the ingredient that changes the hot water of mediocrity to the steam of outstanding success. It's the ingredient that enables a
2007 Aug 23
4
scoring problem in acts_as_ferret
Hi, I am using acts_as_ferret and have a problem with scoring. I would like to organize it in such way that, if any of the searched terms fits, I get 1.0 score as a result. I will explain it on the example. I have in index: a) "one two three four" b) "one two three" c) "one two" d) "one" When I search for "one" I would like to get 1.0 score for
2006 Jun 18
2
Table Relationship for Select option list
I''m pretty new to developing web apps and need help with my database table design. I''m working on an inventory application to manage WLAN hardware. I''ve created a table to hold information on each device with the following (model refers to the manufacturer''s model number): create table devices ( id int not null auto_increment,