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.

Reply via email to