adding the silly hello world controller
This commit is contained in:
parent
6b5ccdcc16
commit
875b2f1ab1
@ -0,0 +1,5 @@
|
||||
class HelloController < ApplicationController
|
||||
def world
|
||||
end
|
||||
|
||||
end
|
2
cookbook/015/01/status/app/helpers/hello_helper.rb
Normal file
2
cookbook/015/01/status/app/helpers/hello_helper.rb
Normal file
@ -0,0 +1,2 @@
|
||||
module HelloHelper
|
||||
end
|
11
cookbook/015/01/status/app/views/hello/world.html.erb
Normal file
11
cookbook/015/01/status/app/views/hello/world.html.erb
Normal file
@ -0,0 +1,11 @@
|
||||
<h1>Several increasingly silly ways of displaying “Hello world!”:</h1>
|
||||
|
||||
<p><%= "Hello world!" %></p>
|
||||
<p><%= "Hello" + " world!" %></p>
|
||||
<p><%= w = "world"
|
||||
"Hello #{w}!" %></p>
|
||||
<p><%= 'H' + ?e.chr + ('l' * 2) %><%= ('o word!').gsub('d', 'ld')%></p>
|
||||
|
||||
<% hello = "Hello" %>
|
||||
<% world = "world!" %>
|
||||
<%= hello %> <%= world %>
|
@ -1,4 +1,6 @@
|
||||
Status::Application.routes.draw do
|
||||
get "hello/world"
|
||||
|
||||
get "status/index"
|
||||
|
||||
# The priority is based upon order of creation:
|
||||
|
@ -0,0 +1,9 @@
|
||||
require 'test_helper'
|
||||
|
||||
class HelloControllerTest < ActionController::TestCase
|
||||
test "should get world" do
|
||||
get :world
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class HelloHelperTest < ActionView::TestCase
|
||||
end
|
Loading…
Reference in New Issue
Block a user