Add action HomeController#show
This commit is contained in:
parent
d6e1140e33
commit
084f3e9b0d
5 changed files with 16 additions and 2 deletions
4
app/controllers/home_controller.rb
Normal file
4
app/controllers/home_controller.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
class HomeController < ApplicationController
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
end
|
1
app/views/home/show.html.erb
Normal file
1
app/views/home/show.html.erb
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<h1>Decentralized Microblog</h1>
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>LessonDecentralizedMicroblogInRuby</title>
|
<title>Decentralized Microblog</title>
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
<%= csp_meta_tag %>
|
<%= csp_meta_tag %>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
|
get 'home/show'
|
||||||
|
root to: 'home#show'
|
||||||
end
|
end
|
||||||
|
|
8
test/controllers/home_controller_test.rb
Normal file
8
test/controllers/home_controller_test.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class HomeControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get show" do
|
||||||
|
get home_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
Reference in a new issue