add layout header and footer
From static-pages into master
-
app/controllers/static_pages_controller.rb 0 → 100644
1 class StaticPagesController < ApplicationController 2 def home -
Master
home,helpkhông phải là action nằm trong restful nha. -
-
-
app/helpers/static_pages_helper.rb 0 → 100644
1 module StaticPagesHelper -
Master
file nào không có nội dung thì xóa đi nha em. Khi nào cần thì tạo lại. Tránh việc quá nhiều file khi review
-
-
-
app/views/layouts/_footer.html.erb 0 → 100644
1 <footer class="footer"> -
MasterEdited by phuctmZigexn
Từ bây giờ, đối với view template thì mình sẽ sử dụng slim template. Tìm hiểu và áp dụng vào tất cả các view nha em
-
-
-
1 1 Rails.application.routes.draw do 2 root 'application#hello' 2 root 'static_pages#home' 3 get 'help' => 'static_pages#help' -
Master
sử dụng cú pháp mới nhé. =>
get 'help', to: 'static_pages#help'Tham khảo: https://guides.rubyonrails.org/routing.html
-
-
-
1 1 Rails.application.routes.draw do 2 root 'application#hello' 2 root 'static_pages#home' 3 get 'help' => 'static_pages#help' 4 get 'about' => 'static_pages#about' 5 # get 'contact' => 'static_pages#contact' -
Master
code bị comment thì xóa luôn nha. Trừ những nội dung text nhầm mô tả, chú thích cho nội dung code.
-
-
-
1 require "test_helper" -
Master
hiện tại mình không cần viết test cho app. nên em xóa mấy file test được generate ra khi chạy command generate controller, model này nọ nha. Ngoài ra thì có 2 cách khác:
- thêm
--no-test-frameworkvào commandrails generate... - áp dụng thử link này https://stackoverflow.com/questions/18001306/dont-generate-test-automatically-in-rails
- thêm
-
-
-
app/views/static_pages/help.html.erb 0 → 100644
1 <h1>StaticPages#help</h1> -
Master
những view này nếu requirement không yêu cầu thì em xóa luôn nha.
-
-
-
added 1 commit
- 9533f83a - rename branch, add top_controller, add slim, add gem pry-rails and pry-nav, remove test framework
Toggle commit list -
-
-
merged
Toggle commit list