Module: Taskr::Views::XML

Includes:
Models
Defined in:
lib/taskr/views.rb

Constant Summary collapse

CONTENT_TYPE =
'text/xml'

Instance Method Summary collapse

Instance Method Details

#create_task_resultObject



34
35
36
37
38
39
# File 'lib/taskr/views.rb', line 34

def create_task_result
  taskr_response_xml(@task.valid? ? 'success' : 'failure') do
    text @task.to_xml
    text @task.errors.to_xml unless @task.valid?
  end
end

#tasks_listObject



26
27
28
# File 'lib/taskr/views.rb', line 26

def tasks_list
  @tasks.to_xml(:root => 'tasks')#, :include => [:task_actions])
end

#view_taskObject



30
31
32
# File 'lib/taskr/views.rb', line 30

def view_task
  @task.to_xml(:root => 'task')#, :include => [:task_actions])
end