mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-25 08:34:08 +01:00
Merge branch 'defer_buttons' of git://github.com/epall/tracks into master
This commit is contained in:
commit
383328fab6
8 changed files with 29 additions and 2 deletions
|
|
@ -384,7 +384,21 @@ class TodosController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
private
|
||||
def defer
|
||||
@source_view = params['_source_view'] || 'todo'
|
||||
numdays = params['days'].to_i
|
||||
@todo = Todo.find(params[:id])
|
||||
@todo.show_from = (@todo.show_from || @todo.user.date) + numdays.days
|
||||
@saved = @todo.save
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :back }
|
||||
format.js {render :action => 'update'}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def get_todo_from_params
|
||||
@todo = current_user.todos.find(params['id'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue