Rails partials and Simplemodal jQuery plugin -
first of sorry title, couldn't think of real descriptive.
so here's thing:
i have site (kinda social-network) have list contact cards (little personal cards, info).
there 2 versions of cards: small , full. when see list of 10 contacts (for example), you'll see 10 small cards , when click 1 of them, should open full card in modal popup (i've chosen simplemodal jquery plugin this).
i've created 2 partials: card_small
, card_full
. both of them expect locals => :contact
so how recommend doing this?
- would render 10 small cards along full version hidden , open modal via jquery on small-card click?
- would render small cards browser , make links_to_remote returns js code renders full card partial?
any other solution or rails plugin welcome. i'm still starting ror =)
generic form of question: need way have 2 partials (small , full) , when small clicked, full 1 needs displayed in modal dialog.
thanks!
this strictly performance tradeoff. it's going depend on how many cards you'll have on page. don't want go crazy , have 1000 copies of may not need, if it's 10, it's fine have them hidden on page. way response doesn't require request server nor delay.
Comments
Post a Comment