From aac108a50da324a285513a4479f01282b41ed30f Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 10 Aug 2011 22:06:36 -0400 Subject: [PATCH] working through 15.13 --- .../015/hodgepodge/app/controllers/list_controller.rb | 8 ++++++++ cookbook/015/hodgepodge/app/helpers/list_helper.rb | 2 ++ cookbook/015/hodgepodge/app/views/list/index.html.erb | 6 ++++++ cookbook/015/hodgepodge/config/routes.rb | 2 ++ .../hodgepodge/test/functional/list_controller_test.rb | 9 +++++++++ .../015/hodgepodge/test/unit/helpers/list_helper_test.rb | 4 ++++ 6 files changed, 31 insertions(+) create mode 100644 cookbook/015/hodgepodge/app/controllers/list_controller.rb create mode 100644 cookbook/015/hodgepodge/app/helpers/list_helper.rb create mode 100644 cookbook/015/hodgepodge/app/views/list/index.html.erb create mode 100644 cookbook/015/hodgepodge/test/functional/list_controller_test.rb create mode 100644 cookbook/015/hodgepodge/test/unit/helpers/list_helper_test.rb diff --git a/cookbook/015/hodgepodge/app/controllers/list_controller.rb b/cookbook/015/hodgepodge/app/controllers/list_controller.rb new file mode 100644 index 0000000..37710f9 --- /dev/null +++ b/cookbook/015/hodgepodge/app/controllers/list_controller.rb @@ -0,0 +1,8 @@ +require 'sha1' + +class ListController < ApplicationController + def index + @list = [1, "string", :symbol, ['list']] + end + +end diff --git a/cookbook/015/hodgepodge/app/helpers/list_helper.rb b/cookbook/015/hodgepodge/app/helpers/list_helper.rb new file mode 100644 index 0000000..eaa1d0e --- /dev/null +++ b/cookbook/015/hodgepodge/app/helpers/list_helper.rb @@ -0,0 +1,2 @@ +module ListHelper +end diff --git a/cookbook/015/hodgepodge/app/views/list/index.html.erb b/cookbook/015/hodgepodge/app/views/list/index.html.erb new file mode 100644 index 0000000..ff97809 --- /dev/null +++ b/cookbook/015/hodgepodge/app/views/list/index.html.erb @@ -0,0 +1,6 @@ + diff --git a/cookbook/015/hodgepodge/config/routes.rb b/cookbook/015/hodgepodge/config/routes.rb index d6bb8ae..42b661c 100644 --- a/cookbook/015/hodgepodge/config/routes.rb +++ b/cookbook/015/hodgepodge/config/routes.rb @@ -1,4 +1,6 @@ Hodgepodge::Application.routes.draw do + get "list/index" + get "foo/count" get "foo/index" get "foo/pretty" diff --git a/cookbook/015/hodgepodge/test/functional/list_controller_test.rb b/cookbook/015/hodgepodge/test/functional/list_controller_test.rb new file mode 100644 index 0000000..3c547f7 --- /dev/null +++ b/cookbook/015/hodgepodge/test/functional/list_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class ListControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + +end diff --git a/cookbook/015/hodgepodge/test/unit/helpers/list_helper_test.rb b/cookbook/015/hodgepodge/test/unit/helpers/list_helper_test.rb new file mode 100644 index 0000000..09cd2a5 --- /dev/null +++ b/cookbook/015/hodgepodge/test/unit/helpers/list_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ListHelperTest < ActionView::TestCase +end