Committing Ben's patch for #868.

Fixes #868.
I wish I could write a spec for it, but RSpec isn't behaving well with partials.
This commit is contained in:
Eric Allen 2009-09-19 19:53:30 -04:00
parent 66de0f9fd8
commit f25ee06c49
2 changed files with 8 additions and 2 deletions

View file

@ -422,6 +422,12 @@ class TodosController < ApplicationController
@projects = current_user.projects
@contexts = current_user.contexts
@contexts_to_show = @contexts.reject {|x| x.hide? }
# Set defaults for new_action
@initial_tag_name = @tag_name
unless @not_done_todos.empty?
@context = current_user.contexts.find_by_id(@not_done_todos[0].context_id)
end
# Set count badge to number of items with this tag
@not_done_todos.empty? ? @count = 0 : @count = @not_done_todos.size

View file

@ -44,7 +44,7 @@
<div class="page_name_auto_complete" id="context_list" style="display:none"></div>
<label for="tag_list">Tags (separate with commas)</label>
<%= text_field_tag "tag_list", nil, :size => 30, :tabindex => 5 %>
<%= text_field_tag "tag_list", @initial_tag_name, :size => 30, :tabindex => 5 %>
<%= content_tag("div", "", :id => "tag_list_auto_complete", :class => "auto_complete") %>
<%= auto_complete_field 'tag_list', {
:url => {:controller => 'todos', :action => 'auto_complete_for_tag'},
@ -135,4 +135,4 @@
<%= calendar_setup( "todo_due" ) %>
<%= calendar_setup( "todo_show_from" ) %>
</div>
</div>
</div>