Sha256: 4d6a41169e695b5b84a4a69679aebaeafe8edd79e4aadbc4e966f650cbb82df9
Contents?: true
Size: 811 Bytes
Versions: 13
Compression:
Stored size: 811 Bytes
Contents
module TodoList class Tasks < Controller map '/' def index @tasks = Task.all @title = request[:title] end def create if request.post? and title = request[:title] title.strip! unless title.empty? Task.create :title => title end end redirect route('/', :title => title) rescue Sequel::DatabaseError => ex redirect route('/', :title => title) end def open(title) Task[:title => Ramaze::Helper::CGI.url_decode(title)].open! redirect r('/') end def close(title) Task[:title => Ramaze::Helper::CGI.url_decode(title)].close! redirect r('/') end def delete(title) Task[:title => Ramaze::Helper::CGI.url_decode(title)].destroy redirect r('/') end end end
Version data entries
13 entries across 13 versions & 1 rubygems