2015-03-21 Rails データの初めの数文字を表示させる方法 例:クラス:Question, コラム名:titleのとき初めの17文字を表示するためにはquestion.title[0,17] ほかにクラスを定義することもできる。 参考: Ruby: How to get the first character of a stringstackoverflow.com