Browse Source

WIP, creating TaskList Controller and edit action & view

denney-fix-saving-dates
Jason Denney 11 years ago
parent
commit
656f0f12e4
  1. 5
      app/controllers/task_lists_controller.rb
  2. 10
      app/views/task_lists/edit.haml
  3. 2
      config/routes.rb

5
app/controllers/task_lists_controller.rb

@ -0,0 +1,5 @@
class TaskListsController < AuthenticatedController
def edit
@task_list = TaskList.find_by_id(params[:id])
end
end

10
app/views/task_lists/edit.haml

@ -0,0 +1,10 @@
%h2 Task List
%h3 #{@task_list.item.shop_id} #{@task_list.item.bike_brand}
%h4 #{@task_list.item.model}
%p
.control-group
- @task_list.tasks.each do |task|
.controls
%input{class: "task_list_task", type: "checkbox", "data-id" => task.id}
#{task.task}

2
config/routes.rb

@ -9,6 +9,8 @@ Velocipede::Application.routes.draw do
get 'bikes/new', to: 'bikes#new', as: "new_bike" get 'bikes/new', to: 'bikes#new', as: "new_bike"
get 'bikes/:id', to: 'bikes#show', as: "bike" get 'bikes/:id', to: 'bikes#show', as: "bike"
get 'task_lists/:id/edit' => "task_lists#edit", as: "edit_task_list"
########################### ###########################
# API Routes # API Routes
scope 'api', :module => :api, defaults: {format: :json} do scope 'api', :module => :api, defaults: {format: :json} do

Loading…
Cancel
Save