on Rails 튜토리얼 3장 - 연습 및 답변
연습
출처) Ruby on Rails 자습서: 예제를 사용하여 Rails 배우기
대답
1.
test/controllers/static_pages_controller_test.rb에 다음을 추가
static_pages_controller_test.rb def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
・
・
・
assert_select "title", "Home | #{@base_title}"
・
・
・
assert_select "title", "Help | #{@base_title}"
・
・
・
assert_select "title", "About | #{@base_title}"

2.
절차:
① (test/controllers/static_pages_controller_test.rb에) contact 테스트 작성
② (config/routes.rb로) contact rooting 설정
③ (app/controllers/static_pages_controller.rb에) contact의 컨트롤러 작성
④ (app/views/static_pages/contact.html.erb에) contact의 뷰를 작성
①

②

③

④

끝
Reference
이 문제에 관하여(on Rails 튜토리얼 3장 - 연습 및 답변), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/katekun/items/cd836a219c72b05e7d4e
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
・
・
・
assert_select "title", "Home | #{@base_title}"
・
・
・
assert_select "title", "Help | #{@base_title}"
・
・
・
assert_select "title", "About | #{@base_title}"
Reference
이 문제에 관하여(on Rails 튜토리얼 3장 - 연습 및 답변), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/katekun/items/cd836a219c72b05e7d4e텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)