Commit bf12793f by Mai Hoang Thai Ha

Finish layout and routes

parent 218d995d
Pipeline #1231 failed with stages
in 0 seconds
...@@ -7,4 +7,7 @@ class StaticPagesController < ApplicationController ...@@ -7,4 +7,7 @@ class StaticPagesController < ApplicationController
def about def about
end end
def contact
end
end end
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<a href="https://www.railstutorial.org/">Ruby on Rails Tutorial</a> <a href="https://www.railstutorial.org/">Ruby on Rails Tutorial</a>
sample application. sample application.
</h2> </h2>
<%= link_to "Sign up now!", '#', class: "btn btn-lg btn-primary"%> <%= link_to "Sign up now!", signup_path, class: "btn btn-lg btn-primary"%>
</div> </div>
<%= link_to image_tag("rails.svg", alt: "Rails logo", width: "200"), <%= link_to image_tag("rails.svg", alt: "Rails logo", width: "200"),
"https://rubyonrails.org" %>" %> "https://rubyonrails.org" %>" %>
Rails.application.routes.draw do Rails.application.routes.draw do
get 'users/new'
root 'static_pages#home' root 'static_pages#home'
get 'static_pages/home' get '/help', to: 'static_pages#help'
get 'static_pages/help' get '/about', to: 'static_pages#about'
get 'static_pages/about' get '/contact', to: 'static_pages#contact'
get 'static_pages/contact' get '/signup', to: 'users#new'
get 'static_pages/example'
end end
...@@ -9,25 +9,25 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest ...@@ -9,25 +9,25 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
@base_title = "Ruby on Rails Tutorial Sample App" @base_title = "Ruby on Rails Tutorial Sample App"
end end
test "should get home" do test "should get home" do
get static_pages_home_url get root_path
assert_response :success assert_response :success
assert_select "title", "#{@base_title}" assert_select "title", "#{@base_title}"
end end
test "should get help" do test "should get help" do
get static_pages_help_url get help_path
assert_response :success assert_response :success
assert_select "title", "Help | #{@base_title}" assert_select "title", "Help | #{@base_title}"
end end
test "should get about" do test "should get about" do
get static_pages_about_url get about_path
assert_response :success assert_response :success
assert_select "title", "About | #{@base_title}" assert_select "title", "About | #{@base_title}"
end end
test "should get contact" do test "should get contact" do
get static_pages_contact_url get contact_path
assert_response :success assert_response :success
assert_select "title", "Contact | #{@base_title}" assert_select "title", "Contact | #{@base_title}"
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment