https://gist.github.com/nacyot/7624036
알아두면 도움이 되는 55가지 루비 기법
루비도 공부했으니. 나중에 루비 쓸때 참고
This is slide 1 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
This is slide 2 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
This is slide 3 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
root
:to
=>
"home#index"
일반적인 게시판 류는 그냥 스캐폴드 로 생성
$ rails generate scaffold Post name:string title:string content:text |
파일 | 목적 |
---|---|
db/migrate/20100207214725_create_posts.rb | 데이터베이스에 ‘posts’ 테이블 생성하는 마이그레이션 (여러분의 파일 이름은, 다른 타임 스템프 값을 가지고 있습니다.) |
app/models/post.rb | Post 모델 |
test/fixtures/posts.yml | 테스트를 위한 더미(Dummy) posts |
app/controllers/posts_controller.rb | Posts 컨트롤러 |
app/views/posts/index.html.erb | 모든 posts 를 출력하는 index 뷰 |
app/views/posts/edit.html.erb | 존재하는 post 를 수정하는 edit 뷰 |
app/views/posts/show.html.erb | 단일 post를 보여주는 show 뷰 |
app/views/posts/new.html.erb | 새로운 post 를 만들기 위한 new 뷰 |
app/views/posts/_form.html.erb | post 를 수정하거나 새로 만드는데 사용되는 폼(form)을 저장하는 조각(partial) 파일 |
app/helpers/posts_helper.rb | post 뷰를 위한 헬퍼(Helper) 함수를 위한 파일 |
test/unit/post_test.rb | posts 모델을 위한 유닛 테스트 파일 |
test/functional/posts_controller_test.rb | posts 컨트롤러를 위한 기능 테스트 파일 |
test/unit/helpers/posts_helper_test.rb | posts 헬퍼(Helper)를 위한 유닛 테스트 파일 |
config/routes.rb | posts 를 위한 라우팅 정보를 담은 수정된 라우팅 파일 |
public/stylesheets/scaffold.css | 발판(Scaffold) 뷰를 좀 더 미려하게 만드는 CSS파일 |