본문 바로가기

Rails

(11)
[Rails] Ordered Hash * ruby에서 hash을 쓰다보면, Hash table에 입력순서대로 값이 들어가질 않는다. 이 Ordered hash을 사용하게 되면, 입력 순서대로 값이 입력된다. Ordered Hash을 위해서, 몇가지 Gem을 설치하였다. GoodLibs - 현재 사용중인 것 (2006.05 이후로 업데이트 이루어지지 않음) Facets - Dictionary - 좀더 유명한 Gems, 하지만 "Sort" method을 지원하지 못한다. Sort method 을 지원하기 위하여, GoodLibs을 다시 설치하였는데, "File is not to unload" 라는 에러 발생한다. Gem 설치하고, Ruby Path가 잡혀있는데도 이런 상황. 혹시나 해서, GoodLibs 설치된 폴더에서 "ruby ordered..
[Ubuntu] Mongrel 사용 # 가정 : Rails 설치 # Mongrel 설치 gem install gem-plugin mongrel mongrel_cluster --include-dependencies Select which gem to install for your platform (i486-linux) 1. mongrel 1.0.1 (mswin32) 2. mongrel 1.0.1 (ruby) 3. mongrel 1.0 (mswin32) 4. mongrel 1.0 (ruby) 5. Skip this gem 6. Cancel installation > 2 Select which gem to install for your platform (i486-linux) 1. fastthread 1.0 (ruby) 2. fastthread ..
Ruby on Rails Models / Views / Controllers 관계 Model- View- Controller Architecture - Model 모델은 Database와 연동하여, data 관리함 - View 뷰는 Model내의 Data을 이용하여, UI부분을 담당한다. - Controller 컨트롤러는 Model과 연동하여, 외부에서 Event들을 받아서 처리하고, 이를 사용자에게 적절한 View을 제공한다. Rails & MVC Instant Gratification Creating New Application > rails app (다음 폴더/ 파일들이 생성됨) > ruby script/server : 서버 동작 : http://localhost:3000 Hello Rails!! (ActionControl..