Displaying 1 result from an estimated 1 matches for "ids_chang".
Did you mean:
id_change
2007 Feb 13
1
Passing Arrays in recursive functions.
...g the done/
not_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.to...