diff --git a/cookbook/015/01/status/app/controllers/hello_controller.rb b/cookbook/015/01/status/app/controllers/hello_controller.rb new file mode 100644 index 0000000..6d366c7 --- /dev/null +++ b/cookbook/015/01/status/app/controllers/hello_controller.rb @@ -0,0 +1,5 @@ +class HelloController < ApplicationController + def world + end + +end diff --git a/cookbook/015/01/status/app/helpers/hello_helper.rb b/cookbook/015/01/status/app/helpers/hello_helper.rb new file mode 100644 index 0000000..b498006 --- /dev/null +++ b/cookbook/015/01/status/app/helpers/hello_helper.rb @@ -0,0 +1,2 @@ +module HelloHelper +end diff --git a/cookbook/015/01/status/app/views/hello/world.html.erb b/cookbook/015/01/status/app/views/hello/world.html.erb new file mode 100644 index 0000000..437bdda --- /dev/null +++ b/cookbook/015/01/status/app/views/hello/world.html.erb @@ -0,0 +1,11 @@ +

Several increasingly silly ways of displaying “Hello world!”:

+ +

<%= "Hello world!" %>

+

<%= "Hello" + " world!" %>

+

<%= w = "world" + "Hello #{w}!" %>

+

<%= 'H' + ?e.chr + ('l' * 2) %><%= ('o word!').gsub('d', 'ld')%>

+ +<% hello = "Hello" %> +<% world = "world!" %> +<%= hello %> <%= world %> diff --git a/cookbook/015/01/status/config/routes.rb b/cookbook/015/01/status/config/routes.rb index c1a10d8..d35b1d2 100644 --- a/cookbook/015/01/status/config/routes.rb +++ b/cookbook/015/01/status/config/routes.rb @@ -1,4 +1,6 @@ Status::Application.routes.draw do + get "hello/world" + get "status/index" # The priority is based upon order of creation: diff --git a/cookbook/015/01/status/test/functional/hello_controller_test.rb b/cookbook/015/01/status/test/functional/hello_controller_test.rb new file mode 100644 index 0000000..b0b489f --- /dev/null +++ b/cookbook/015/01/status/test/functional/hello_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class HelloControllerTest < ActionController::TestCase + test "should get world" do + get :world + assert_response :success + end + +end diff --git a/cookbook/015/01/status/test/unit/helpers/hello_helper_test.rb b/cookbook/015/01/status/test/unit/helpers/hello_helper_test.rb new file mode 100644 index 0000000..df82ec0 --- /dev/null +++ b/cookbook/015/01/status/test/unit/helpers/hello_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class HelloHelperTest < ActionView::TestCase +end