My favorites | Sign in
Project Logo
          
Search
for
Updated Sep 20, 2007 by cainlevy
Labels: Featured
HelperExamples  
Example uses of the RecordSelect helpers

record_select_field

<% form_tag do %>
  Amount: <%= text_field_tag 'amount' %><br />
  Description: <%= text_field_tag 'description' %><br />
  User: <%= record_select_field 'user', selected_user || User.new %><br />
<% end %>

record_multi_select_field

<% form_tag do %>
  Amount: <%= text_field_tag 'amount' %><br />
  Description: <%= text_field_tag 'description' %><br />
  User: <%= record_multi_select_field 'user', @current, :controller => 'users' %><br />
<% end %>

link_to_record_select

<%= link_to_record_select 'Pick A User', 'users', :onselect => "alert('You picked ' + label + ', id#' + id);" %>

You can see these examples in action in the demo.



Sign in to add a comment
Hosted by Google Code