All,

(sorry, I mis-titled this post as "Best way to add custom onclick
handler to select options" and posted it before I could fix the title).

I want to make an individual <option> in a <select> act as an in-place
edit field.

I get how the in_place_editor works, and it appears if I simply place a
tag "around" the <option> of interest, and then mark this tag as the
edit-in-place target, I should be good.

The trick is how do I easily decorate the <option> tag with a <p> or
<span> tag?  By "decorate" I mean that the HTML output would be

<span id="edit_in_place"><option>...</option></span>

The standard select() and options_for_select() helpers only take
enumerations with ids and values, they don't allow for any customization
as to tags around the <option> tag.

It seems like I have two options:

1) Completely compose the options for my select "by hand."  Then I can
do whatever I want.

2) I could call "options_for_select" and then using some crazy regex,
modify the output text and decorate my option of interest that way.

Was curious if anyone had some clever suggestions and would be willing
to share them with me.

Thanks,
Wes
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to