On Fri, 2007-05-04 at 16:26 +0200, Thomas Weibel wrote:
> One more thing: How would I preselect a certain entry like this?
Never mind, I figured it out:

      @roles.each { |k,v|
        if @user and @[EMAIL PROTECTED] == v.to_s
          option v.to_s, :value => k, :selected => "selected"
        else
          option v.to_s, :value => k
        end
      }

Obviously, XHTML need "selected='selected'" anyway.

Thomas

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Camping-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to