mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
Adding api task_lists#show and spec, edit.haml updates
This commit is contained in:
@@ -8,13 +8,9 @@ class Api::V1::TaskListsController < Api::V1::BaseController
|
||||
def show
|
||||
end
|
||||
|
||||
def edit
|
||||
#@task_list.update_attributes(params)
|
||||
end
|
||||
|
||||
private
|
||||
def get_task_list
|
||||
@task_list = TaskList.find(params[:id])
|
||||
@task_list = TaskList.find_by_id(params[:id])
|
||||
if @task_list.nil?
|
||||
render json: { errors: [NOT_FOUND] }, status: 404 and return
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ class TaskList < ActiveRecord::Base
|
||||
attr_accessible :item_id, :item_type, :name
|
||||
|
||||
belongs_to :item, :polymorphic => true
|
||||
has_many :tasks
|
||||
has_many :tasks, order: "id ASC"
|
||||
|
||||
after_save :create_default_bike_tasks
|
||||
|
||||
|
||||
@@ -6,5 +6,8 @@
|
||||
.control-group
|
||||
- @task_list.tasks.each do |task|
|
||||
.controls
|
||||
%input{class: "task_list_task", type: "checkbox", "data-id" => task.id}
|
||||
%input{class: "task_list_task", type: "checkbox", "data-id" => task.id, checked: task.done}
|
||||
#{task.task}
|
||||
.control-group
|
||||
.controls
|
||||
%input{id: "update_tasks_submit", value: "Save Changes", type: "button", class: "btn btn-lg btn-block btn-primary disabled", "data-url" => "#{api_update_task_path}"}
|
||||
|
||||
Reference in New Issue
Block a user