OSDN Git Service

Add hello controller.
authorTatsuki Sugiura <sugi@nemui.org>
Wed, 12 Mar 2014 04:57:50 +0000 (13:57 +0900)
committerTatsuki Sugiura <sugi@nemui.org>
Wed, 12 Mar 2014 04:57:57 +0000 (13:57 +0900)
app/assets/javascripts/hello.js.coffee [new file with mode: 0644]
app/assets/stylesheets/hello.css.scss [new file with mode: 0644]
app/controllers/hello_controller.rb [new file with mode: 0644]
app/helpers/hello_helper.rb [new file with mode: 0644]
app/views/hello/index.html.erb [new file with mode: 0644]
config/routes.rb
test/controllers/hello_controller_test.rb [new file with mode: 0644]
test/helpers/hello_helper_test.rb [new file with mode: 0644]

diff --git a/app/assets/javascripts/hello.js.coffee b/app/assets/javascripts/hello.js.coffee
new file mode 100644 (file)
index 0000000..24f83d1
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://coffeescript.org/
diff --git a/app/assets/stylesheets/hello.css.scss b/app/assets/stylesheets/hello.css.scss
new file mode 100644 (file)
index 0000000..41d87a4
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the hello controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/controllers/hello_controller.rb b/app/controllers/hello_controller.rb
new file mode 100644 (file)
index 0000000..5203753
--- /dev/null
@@ -0,0 +1,4 @@
+class HelloController < ApplicationController
+  def index
+  end
+end
diff --git a/app/helpers/hello_helper.rb b/app/helpers/hello_helper.rb
new file mode 100644 (file)
index 0000000..b498006
--- /dev/null
@@ -0,0 +1,2 @@
+module HelloHelper
+end
diff --git a/app/views/hello/index.html.erb b/app/views/hello/index.html.erb
new file mode 100644 (file)
index 0000000..b6c7bb6
--- /dev/null
@@ -0,0 +1,2 @@
+<h1>Hello#index</h1>
+<p>Find me in app/views/hello/index.html.erb</p>
index 402535b..8394707 100644 (file)
@@ -1,4 +1,5 @@
 Hello::Application.routes.draw do
+  get "hello/index"
   # The priority is based upon order of creation: first created -> highest priority.
   # See how all your routes lay out with "rake routes".
 
diff --git a/test/controllers/hello_controller_test.rb b/test/controllers/hello_controller_test.rb
new file mode 100644 (file)
index 0000000..a23fd88
--- /dev/null
@@ -0,0 +1,9 @@
+require 'test_helper'
+
+class HelloControllerTest < ActionController::TestCase
+  test "should get index" do
+    get :index
+    assert_response :success
+  end
+
+end
diff --git a/test/helpers/hello_helper_test.rb b/test/helpers/hello_helper_test.rb
new file mode 100644 (file)
index 0000000..df82ec0
--- /dev/null
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class HelloHelperTest < ActionView::TestCase
+end