 <p>Haven't tested it, but I think the following should work. </p> <pre><code>def index @histories = History.all(:order =&gt; 'REPLACE(title,"Post","")+0 ASC') end mysql&gt; desc z; +------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | a | varchar(255) | YES | | NULL | | +-------+--------------+------+-----+---------+-------+ 1 row in set (0.00 sec) mysql&gt; select * from z; +---------+ | a | +---------+ | post 1 | | post 11 | | post 2 | +---------+ 3 rows in set (0.00 sec) mysql&gt; select * from z order by a asc; +---------+ | a | +---------+ | post 1 | | post 11 | | post 2 | +---------+ 3 rows in set (0.00 sec) mysql&gt; select * from z order by REPLACE(a,"post","")+0 ASC; +---------+ | a | +---------+ | post 1 | | post 2 | | post 11 | +---------+ 3 rows in set (0.00 sec) </code></pre>