I was suggesting acts_as_list in IRC as it handles much of what you're
looking for I believe.

On Mar 25, 1:57 pm, Alex Bowyer <[email protected]> wrote:
> I have a fairly simple scenario:
>
> Voters (name + email address) vote on Choices (name, details, URL)
> I want voters to be able to pick one "first choice", one "second
> choice" and one "third choice" - their vote consists of these exactly
> 3 selections.
>
> So the two questions to answer are
> 1) what's the best way to model this
> 2) how to create a form where the user can select these three choices
>
> 1) Model
>
> Based on what I've learnt so far, i'm thinking a link table would work
> - voter_choices...
> ie.
> Voter has_many Choices :through voter_choices
> Choices has_many Voters :through voter_choices
> then fix it to be just 3 votes with validation
> I was thinking then add a "rank" field to the link table and use
> validation to ensure there is only ever one entry per user for each
> rank (1,2,3)
>
> Is this the best way to model it or is there a better way?
>
> 2) Form
>
> So far I have done this by using :accessible=>true on the has_many
> choices line within Voter
> This kind of works, but doesn't let me select the rank.
> I could create the form manually, but I was wondering if there is some
> easier way to do this using Hobo magic.
>
> I guess I'm really looking for a design approach plus tips on any
> particular hobo features that would be useful.
>
> Thanks for any help you can give.
>
> Alex Bowyer

-- 
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