我想學習rails [通過遵循coursera中的SAAS課程]並使用ActiveRecord使用簡單的Movie表。Rails:ActiveRecord db排序操作不區分大小寫
我想顯示標題排序的所有電影。我希望它不區分大小寫。
我試圖做這樣說:
Movie.all(:conditions => ["lower(title) = ?", title.downcase],:order => "title DESC")
=>undefined local variable or method `title' for #<MoviesController:0xb4da9a8>
我覺得它不承認較低(職稱)。
這是實現案例評估的最佳方式嗎?
謝謝!