From: Tatsuki Sugiura Date: Wed, 12 Mar 2014 04:57:50 +0000 (+0900) Subject: Add hello controller. X-Git-Url: http://git.osdn.net/view?p=example%2Fhello.git;a=commitdiff_plain;h=1f232385116d946b184a78229c7843f856f8ca62 Add hello controller. --- diff --git a/app/assets/javascripts/hello.js.coffee b/app/assets/javascripts/hello.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/hello.js.coffee @@ -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 index 0000000..41d87a4 --- /dev/null +++ b/app/assets/stylesheets/hello.css.scss @@ -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 index 0000000..5203753 --- /dev/null +++ b/app/controllers/hello_controller.rb @@ -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 index 0000000..b498006 --- /dev/null +++ b/app/helpers/hello_helper.rb @@ -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 index 0000000..b6c7bb6 --- /dev/null +++ b/app/views/hello/index.html.erb @@ -0,0 +1,2 @@ +

Hello#index

+

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

diff --git a/config/routes.rb b/config/routes.rb index 402535b..8394707 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 index 0000000..a23fd88 --- /dev/null +++ b/test/controllers/hello_controller_test.rb @@ -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 index 0000000..df82ec0 --- /dev/null +++ b/test/helpers/hello_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class HelloHelperTest < ActionView::TestCase +end