diff --git a/cookbook/015/hodgepodge/app/controllers/foo_controller.rb b/cookbook/015/hodgepodge/app/controllers/foo_controller.rb new file mode 100644 index 0000000..392a279 --- /dev/null +++ b/cookbook/015/hodgepodge/app/controllers/foo_controller.rb @@ -0,0 +1,5 @@ +class FooController < ApplicationController + def index + end + +end diff --git a/cookbook/015/hodgepodge/app/controllers/status_controller.rb b/cookbook/015/hodgepodge/app/controllers/status_controller.rb index 7f0ffeb..f15057f 100644 --- a/cookbook/015/hodgepodge/app/controllers/status_controller.rb +++ b/cookbook/015/hodgepodge/app/controllers/status_controller.rb @@ -1,5 +1,6 @@ class StatusController < ApplicationController def index + @title = "System Status" time = Time.now @time = time @ps = `ps aux` diff --git a/cookbook/015/hodgepodge/app/helpers/foo_helper.rb b/cookbook/015/hodgepodge/app/helpers/foo_helper.rb new file mode 100644 index 0000000..c3ad23b --- /dev/null +++ b/cookbook/015/hodgepodge/app/helpers/foo_helper.rb @@ -0,0 +1,2 @@ +module FooHelper +end diff --git a/cookbook/015/hodgepodge/app/views/foo/index.html.erb b/cookbook/015/hodgepodge/app/views/foo/index.html.erb new file mode 100644 index 0000000..6bdfb2d --- /dev/null +++ b/cookbook/015/hodgepodge/app/views/foo/index.html.erb @@ -0,0 +1,2 @@ +

Foo#index

+

Find me in app/views/foo/index.html.erb

diff --git a/cookbook/015/hodgepodge/app/views/layouts/application.html.erb b/cookbook/015/hodgepodge/app/views/layouts/application.html.erb index d27351b..caf0829 100644 --- a/cookbook/015/hodgepodge/app/views/layouts/application.html.erb +++ b/cookbook/015/hodgepodge/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - Hodgepodge + My Website - <%= @title %> <%= yield %> diff --git a/cookbook/015/hodgepodge/config/routes.rb b/cookbook/015/hodgepodge/config/routes.rb index 654829d..ce31f9e 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 "foo/index" + # The priority is based upon order of creation: # first created -> highest priority. diff --git a/cookbook/015/hodgepodge/test/functional/foo_controller_test.rb b/cookbook/015/hodgepodge/test/functional/foo_controller_test.rb new file mode 100644 index 0000000..289ffba --- /dev/null +++ b/cookbook/015/hodgepodge/test/functional/foo_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class FooControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + +end diff --git a/cookbook/015/hodgepodge/test/unit/helpers/foo_helper_test.rb b/cookbook/015/hodgepodge/test/unit/helpers/foo_helper_test.rb new file mode 100644 index 0000000..f4454c1 --- /dev/null +++ b/cookbook/015/hodgepodge/test/unit/helpers/foo_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class FooHelperTest < ActionView::TestCase +end