Abstracted the :start_year option in the date_select call in the forms, so that it starts at this year without having to hard code it.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@37 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2005-03-05 19:57:41 +00:00
parent 6703f48333
commit 0755309684
3 changed files with 6 additions and 3 deletions

View file

@ -23,7 +23,8 @@
<%= options_from_collection_for_select(@projects, "id", "name" ) %>
</select><br />
<label for="new_item_due">Due</label><br />
<%= date_select( "new_item", "due", :include_blank => true, :start_year => 2005 ) %>
<% now = Date.today %>
<%= date_select( "new_item", "due", :include_blank => true, :start_year => now.year, "tabindex" => 5 ) %>
<br />
<input type="submit" value="Add item">
</form>

View file

@ -30,7 +30,8 @@
</select>
<br />
<label for="new_item_due">Due</label><br />
<%= date_select( "new_item", "due", :include_blank => true, :start_year => 2005 ) %>
<% now = Date.today %>
<%= date_select( "new_item", "due", :include_blank => true, :start_year => now.year, "tabindex" => 5 ) %>
<br />
<input type="submit" value="Add item">
</form>

View file

@ -36,6 +36,7 @@
</select>
<br />
<label for="item_due" tab>Due</label><br />
<%= date_select( "item", "due", :include_blank => true, :start_year => 2005, "tabindex" => 5 ) %>
<% now = Date.today %>
<%= date_select( "item", "due", :include_blank => true, :start_year => now.year, "tabindex" => 5 ) %>
<br />
<br />