Displaying 12 results from an estimated 12 matches for "color_id".
Did you mean:
color_idx
2006 Jul 10
18
Deleting join association of has_many :through
I''m trying to use has_many :through, since my join model deserves being
more than just an intersection table.
But when I try to break the association, the break only seems
"temporary":
Let''s say my two tables are Users and Colors, and the join model is
Favorites.
user = Users.find(1)
user.colors.length
>> 2
c = user.colors.first
>> #<Color:....>
2008 Feb 28
2
change drop down list to radio buttons
...lors selected from the database. Instead I would like to
create a radio button for each color. The user is allowed to check one
color and this will be saved back into the database as the color for
this user.
I don''t know how to do this. Currently it looks like this:
<%= select(:user, :color_id, Color.find(:all).collect {|c| [ c.name,
c.id ] }, { :include_blank => false })%>
--~--~---------~--~----~------------~-------~--~----~
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 ruby...
2006 May 14
4
searching on foreing keys
Hey all,
I''m using a simple search function. It''s working
great except for foreign keys.
I have one table pets (id,name,owner_id)
and another table people(id,name)
owner_id being a foreign key of pet pointing to people name.
here it is on the pet controller:
@paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id
like
2006 Mar 22
3
Parent-Child Tables Help
can someone help me with this
i have a table
cars
(
id int
model_id int
make_id int
color_id int
description text
constraint fk_cars_carmake foreign key(make_id) references
carmakes(id),
constraint fk_cars_carmodel foreign key(model_id) references
carmodels(id),
constraint fk_cars_color foreign key(color_id) references colors(id)
)
carmakes
(
id int
carmake varchar
)
carmodels
(...
2006 May 22
6
existing magic to prevent db redundancy?
suppose users have a favorite colour, linked to with a color_id field.
suppose also they have a pet rock, which is one of many possible
colors...
is there a ''best practice'' in order to avoid having ''blue'' appear in the
Color table 100 times. can validates_uniqueness_of be twisted into
handling this case? should i be addi...
2005 Oct 05
3
Shopping Cart: SKU and Product Confusion
...ed by the client were not specific to the combination each product
offers. So, the related DB tables were essentially this:
Table Products:
===========
id | sku | title | price | etc...
Table Colors:
=========
id | color
Table Sizes:
=========
id | sizes
Table Colors_Products:
=================
color_id | product_id
Table Products_Sizes:
================
product_id | size_id
Everything was fine and dandy until I got to the point where I wanted each
combination of a product to appear as a separate line item in the shopping
cart (the natural way to display items). There was no way for me to
determ...
2006 Mar 01
0
link_to problem when used in folder
...mileage_from=0
As you can see "site" is dublicated in the url showing up as "site/site"
if I debug params I get the following:
!ruby/hash:HashWithIndifferentAccess reg_year_to: price_from: "0"
transmission_id: fuel_type_id: reg_year_from: metallic: action: results
color_id: make_id: category_id: *controller: site/search* used:
order_by: price mileage_to: mileage_from: "0" price_to: model_id:
The way to workaround this for me was to add the following code:
params.update({:controller => controller.controller_name, :action =>
controller.action_name})...
2006 Jan 09
0
Problem with publishing subclasses by AWS API specification
...:radius, :int
end
class Rectangle < Square
member :height, :int
end
class ShapeApi < ActionWebService::API::Base
api_method :store_shape,
:expects => [Shape]
end
WSDL:
...
<xsd:complexType name="Shape">
<xsd:all>
<xsd:element name="color_id" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
...
--
Posted via http://www.ruby-forum.com/.
2006 Jan 11
0
HELP!! - Problem with AWS and subclasses
...:radius, :int
end
class Rectangle < Square
member :height, :int
end
class ShapeApi < ActionWebService::API::Base
api_method :store_shape,
:expects => [Shape]
end
WSDL:
...
<xsd:complexType name="Shape">
<xsd:all>
<xsd:element name="color_id" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
...
--
Posted via http://www.ruby-forum.com/.
2007 Nov 02
0
How to edit many-to-many -- rhtml setup?
...es: "colors" has a color and id column and rows "red",
"green", blue". "cars" has maker and id columns and rows for "ford",
"chevy", "dodge". I''ve got a 3rd table, inventory. It''s got columns
for car_id, color_id and qty. So I''d like to display a table on screen
that looks something like this:
red green blue
ford 17 12 3
chevy 9 21 11
dodge 19 1 8
(Bah! This will look like hell in whatever different-font you''re
re...
2006 Sep 05
0
rake craziness with Migrate as a dependency
...ot;user_id"], {:name=>"user_id"})
-> 0.2100s
-- create_table("images", {:force=>true})
-> 0.0900s
-- add_index("images", ["product_id"], {:name=>"fk_images_product"})
-> 0.2210s
-- add_index("images", ["color_id"], {:name=>"fk_images_color"})
-> 0.2400s
-- create_table("products", {:force=>true})
-> 0.1000s
-- create_table("roles", {:force=>true})
-> 0.0900s
-- add_index("roles", ["parent_id"], {:name=>"roles_parent_i...
2008 Jan 21
4
Rails app cannot connect to Ferret server
...round_color, :family_tree, :notified_expired,
:ad_kind_id, :callname, :show_bold_border, :race_id, :castrated,
:display_type, :homepage_url, :distinctive_features, :email,
:read_count, :age, :duration, :title, :show_contact, :ts_create,
:age_unit, :price, :show_image_on_list, :phone2, :ts_display, :color_id,
:show_bold_text, :phone1, :disappeared_from, :qty_available,
:date_sale_ready, :phone3, :user_id, :ts_expire]
ArgumentError (wrong number of arguments (1 for 0)):
(druby://localhost:9010)
/vendor/plugins/acts_as_ferret/lib/bulk_indexer.rb:19:in
`ferret_enabled?''
(druby://localho...