Sure I can. Here it goes:
that unique shorthand helped but the other problem that i was talking
about is that on each product's card I get to create properties
instead of selecting the ones that have been already created (I think
i need to overwrite the form action - eureka! but i'm not sure how to
merge it so i only replace the functionality thats wrong and not the
whole page.) The problem with the properties and product specific
values is that when I create say Hight and Width and set them to 10
and 20 cm accordingly i dont get a page that looks like
*page content*
Properties
---------
Hight :10 cm
Width: 20 cm
Instead i get something like
Properties
--------------
Hight
has one value
Width
Has one value
And I need to click it to see that value. Its also messed up because i
dont get the edit product page like
[properties dropdown] [(product specific )value input box] [+]
i get something like
[properties input box] [+][-]
value input box [+][-]
I can assign many values to the same property for one product and
thats wrong. I need that but for separate products. Where did I mess
up?
On Aug 30, 8:28 pm, kevinpfromnm <[email protected]> wrote:
> the multiple name issue what you want is a uniqueness validation.
> hobo has a shortcut when you define the field, you can add :unique =>
> true and it adds a basic validates_uniqueness_of declaration for that
> field. if you have more complicated uniqueness (i.e. name should be
> unique for a given product_id but there can be more than one instance
> of name in the same table), you'll need to use the standard rails
> validation where you can add scope.
>
> I'm not quite sure what you're asking for the other part of your
> question. can you perhaps clarify?
>
> On Aug 28, 3:46 pm, Scorpio <[email protected]> wrote:
>
> > I'm trying to tackle a rather interesting problem.
>
> > My setup:
>
> > model_resources:
> > Product
> > Property
> > PropertyValue
>
> > associations:
> > product has_many properties
> > property has_many property_values
> > (the rest is very fluid as I try for the 100th time)
>
> > I'm experimenting with joins to get the following end-result.
> > On my Product card I want to display a list of properties that have
> > been created and assign property values to them that are product-
> > specific so that once a property has been selected it can have
> > multiple values depending on the product. As far as displaying that
> > goes I'd like to show it in the product card and only those sets of
> > properties and values that have been assigned to that product with the
> > ability to change the selected properties in that card (done) and edit
> > in place the values on that same card
>
> > So far I managed to get all that in one view, add/remove properties
> > and thats working fine but there are a few other problems. the
> > properties and values are not unique (I can make 2 properties with the
> > same name and I've got a create form not a select existing list) also
> > the property values display as "has one property value" instead of say
> > an editable form field with a value inside.
>
> > I'd gladly fix it myself but I have no idea how to bind values and
> > properties on a product-specific level.
> > Any pointer as to the order of tasks that need to be preformed to fix
> > this would be great (I'm still somewhat new at rails and noob at hobo
> > so I'm not sure how to do it exactly but once I have a list to guide
> > me I should be able to slowly work my way through it). Any pointers on
> > the harder parts would be great tho :)
>
> > Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.