Top Stories published by Ruby or Rails in January of 2014

classify의 복수형 문자열 처리

Rails study를 기록해둡니다. 

Rails API에 의하면 classify는 복수형 문자열(ex. “posts”)에 대하여 클래스 선언에 적절한 문자열로 변환해준다. 물론 단수형 문자열에 대해서도 동일하게 동작. 그러나 여기서 business, XXXclass와 같은 s로 끝나는 문자의 경우에는 단수형임에도 s를 삭제하여 적절하지 못한 문자열을 리턴한다. 물론, API에도 아래와 같이 설명되어 있음.

About
Ruby or Rails
Anything about ruby or rails. And learning tips.
More information
Editors
Writers