Skip to content
Browse files

weekのindexとshowページを作って画面から雰囲気を感じた

  • Loading branch information...
1 parent 3c11d9a commit c7755f2fa495180231e3b749e26b587abbe725dc Tagaki Aki committed Jul 26, 2012
Showing with 16 additions and 0 deletions.
  1. +9 −0 app/controllers/weeks_controller.rb
  2. +5 −0 app/views/weeks/index.html.haml
  3. +1 −0 app/views/weeks/show.html.haml
  4. +1 −0 config/routes.rb
View
9 app/controllers/weeks_controller.rb
@@ -0,0 +1,9 @@
+class WeeksController < ApplicationController
+ def index
+ @weeks = Week.all
+ end
+
+ def show
+ @week = Week.find(params[:id])
+ end
+end
View
5 app/views/weeks/index.html.haml
@@ -0,0 +1,5 @@
+%h1 お掃除当番システム
+= link_to '社員情報', members_path
+
+- @weeks.each do |week|
+ = link_to week.start, week
View
1 app/views/weeks/show.html.haml
@@ -0,0 +1 @@
+%h1 #{@week.start} ~ の掃除当番
View
1 config/routes.rb
@@ -1,5 +1,6 @@
CleanUpDuty::Application.routes.draw do
resources :members
+ resources :weeks
# The priority is based upon order of creation:
# first created -> highest priority.

0 comments on commit c7755f2

Please sign in to comment.
Something went wrong with that request. Please try again.