This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Select_field_view
Creates a drop-down menu at the location of the tag:
<%= select_field_view :name,
:options => ['Array', 'of', 'options'],
:bind => { 'bindings' } %>
Because this is a Ruby evaluation, you can use ruby’s methods to generate arrays very quickly. “1..3” in the place of [‘Array’, ‘of’, ‘options’] turns into [1,2,3], for example.
The array can also contain pairs:
[ [1, 'one'],[2, 'two'], [3, 'three'] ] #=> Displays as "One, two, three"
#=> but holds values "1, 2, 3"
An elegant way of creating the above array would be to use Ruby’s Array#Zip:
(1..3).zip([:one, :two, :three])






