Displaying 1 result from an estimated 1 matches for "task_complete".
2007 Feb 13
1
Passing Arrays in recursive functions.
...t_done flag on the view but I''m hitting a problem and I''m not sure
how to get around it.
[model]
  def completed?
    self.siblings.all? { |x| x.done } if self.parent
  end
[controller]
 def task_done
   @task = Task.find(params[:id])
   is_complete = !@task.done
   ids_changed = task_complete!(@task, is_complete)
   words = is_complete ? " " : " Not "
   flash[:notice] = "Task is#{words}finished"
    if request.xhr? then
      render :update do |page|
        ids_changed.each {|x|
          page.toggle "td_#{x}"
          page.toggle "menu_#{...