Model 명명규칙 관례를 따르지 않을 경우

IT(Old)/RubyOnRails-Tip 2008. 1. 21. 15:32

User < ActiveREcord:Base
  set_table_name "user_tbl"
end

와 같이 강제로 table을 지정해 주어야 된다.


TIP : User  모델 클래스는 레일스 애플리케이션이 처음 구동될 때, 데이터베이스에 연결하여 users테이블의
필드 목록을 읽어들이게 된다. users 테이블의 필드 목록을 확인한 User 모델 클래스는 각 필드에 해당하는 접근자 메소드를 동적으로 정의하여 추가한다. 데이터 베이스 테이블의 필드를 확인하고 이에 해당하는 접근자
메소드를 동적으로 추가하는 User 모델 클래스의 기능으 ActiveRecord::Base클래스로 부터 상속되고 있다.

rails 플러그인 목록 주소(http://agilewebdevelopment.com/plugins/list)

IT(Old)/RubyOnRails 2008. 1. 21. 15:16

http://agilewebdevelopment.com/plugins/list


설치법
ruby script/plugin install
http://daesan.com/svn/simple_rss

플러그인은 각 애플리케이션의 vendor/plugins/ 디렉토리에 저장된다.

각 mode별로 start 방법

IT(Old)/RubyOnRails-Tip 2008. 1. 21. 15:14
1.서버
ruby script/server -e development
ruby script/server -e test
ruby script/server -e production

-e가 생략되면 디폴트로 development 로 실행된다.

2. migration
rake dbLmigrate RAILS_ENV=development
rake dbLmigrate RAILS_ENV=test
rake dbLmigrate RAILS_ENV=production