choidacheeze's blog

  • 홈
  • 태그
  • 미디어로그

Rails 2

Rails App에 Bootstrap 사용하기

versions Rails 5.1이상 Bootstrap 4 이상 Gemfile Gemfile에 bootstrap과 의존관계인 jQuery를 설치 gem 'bootstrap' gem 'jquery-rails'$ bundle installapplication.scss Rails App 작성 시에 생성되는 application.css를 application.scss로 rename해준다. $ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss생성된 application.scss에 기존 코드를 삭제 후 bootstrap을 import하기 @import "bootstrap";scss파일에서 i..

프로그래밍/Rails 2020.12.30

_path와 _url의 차이

Rails route를 작성하면 controller에서 사용할 수 있는 헬퍼의 일종인 _path와 _url의 차이를 알아보자. _path 상대패스 redirect_to 외에서 사용 link_to에서 많이 사용 root_path => '/' new_path => '/new' _url 절대패스 redirect_to에서 많이 사용(HTTP에서는 리다이렉트할 때 완전한 URL을 요구하므로) root_url => 'http://www.example.com/' new_url => 'http://www.example.com/new'

프로그래밍/Rails 2020.11.10
이전
1
다음
더보기
프로필사진

choidacheeze's blog

주로 개발 공부. 기억. 기록.

  • 분류 전체보기 (10)
    • 일본생활-기록 (0)
    • 프로그래밍 (10)
      • Ruby (5)
      • Rails (5)
      • tips (0)
    • 먹기, 놀기 (0)

Tag

ruby #symbol, URL, bootstrap, ruby #변수 #상수, Rails, rbenv, Ruby, Path,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바