similar to: messed-up habtm relationship

Displaying 20 results from an estimated 700 matches similar to: "messed-up habtm relationship"

2006 Jan 02
0
Many to Many relationship - trys to destroy twice??
I''m trying to work with a many to many relationship but since my join table need additional attributes I can''t use habtm. When I attempt to destroy an item from the join table RoR appears to attempt to destroy the item twice. Here is an example from the log file showing the process. The record is identified using a find_by_sql using the two id parameters (and a third
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 Jul 05
1
newbie question: Mapping Collections
Hi, Day 3 with rails here. Forgive me. If this has been covered many times before, pls just point me at the article. I worked through the Rolling with Rails tutorial (http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html) built up my cookbook. Things work great. I now want to add Ingredients to my app. So, a Recipe will have 1 or more Ingredients and any single ingredient can be
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
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
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
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
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
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
2006 Feb 27
2
Find not working
Hello all. I have the following code (taken from the depot tutorial then modified) def add_dish( dish, type, qnty ) item = @items.find {|i| i.dish_id == dish.id && i.type == type } if item item.quantity += qnty.to_i else if type == ''Fresh'' item = Fresh.for_dish(dish) else item = Frozen.for_dish(dish) end
2010 Feb 14
2
has_many :through eager loading only loading one record
Hello, I''ve been using Rails for years, including has_many :through and eager loading, but this one has me stumped. The problem is that Active Record is only eager-loading the first of many records. Here are the models (note set_table_name for a legacy schema): class Tag < ActiveRecord::Base set_table_name ''tag'' end class DishTag < Tag has_many
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
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 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,
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 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