<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -585,6 +585,13 @@ module Formtastic #:nodoc:
     #   f.input :author, :value_method =&gt; :login
     #   f.input :author, :value_method =&gt; Proc.new { |a| &quot;author_#{a.login}&quot; }
     #
+    # You can pre-select a specific option value by passing in the :select option.
+    # 
+    # Examples:
+    #  
+    #   f.input :author, :selected =&gt; current_user.id
+    #   f.input :author, :value_method =&gt; :login, :selected =&gt; current_user.login
+    #
     # You can pass html_options to the select tag using :input_html =&gt; {}
     #
     # Examples:</diff>
      <filename>lib/formtastic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1374,6 +1374,26 @@ describe 'SemanticFormBuilder#input' do
         end
       end
     end
+  
+    describe 'when :selected is set' do
+      before do
+        @new_post.stub!(:author_id).and_return(nil)
+        semantic_form_for(@new_post) do |builder|
+          concat(builder.input(:author, :as =&gt; :select, :selected =&gt; @bob.id ))
+        end
+      end
+       
+      it 'should have a selected item' do
+        output_buffer.should have_tag(&quot;form li select option[@selected='selected']&quot;)
+      end
+      
+      it 'bob should be selected' do
+        output_buffer.should have_tag(&quot;form li select option[@selected='selected']&quot;, /bob/i)
+        output_buffer.should have_tag(&quot;form li select option[@selected='selected'][@value='42']&quot;)
+      end
+      
+    end
+  
   end
 
   describe ':as =&gt; :check_boxes' do</diff>
      <filename>spec/input_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9ef91e8a4ba6e1f0eca79228e2e7d4e2930afb32</id>
    </parent>
  </parents>
  <author>
    <name>Justin French</name>
    <email>justin@indent.com.au</email>
  </author>
  <url>http://github.com/justinfrench/formtastic/commit/70755b470ed14cc26b2b723a6521d90ba864cecc</url>
  <id>70755b470ed14cc26b2b723a6521d90ba864cecc</id>
  <committed-date>2009-10-26T14:17:47-07:00</committed-date>
  <authored-date>2009-10-26T14:17:47-07:00</authored-date>
  <message>added some documentation and beefed up specs for the :selected option on a :select input</message>
  <tree>17af1a1a88b039e6b336f33fb6092af688fdc5ee</tree>
  <committer>
    <name>Justin French</name>
    <email>justin@indent.com.au</email>
  </committer>
</commit>
