今私はコントローラーを持っています:
class CommonController < ApplicationController
def location
@locations=Location.select(:key)
render json: @locations
end
end
私のデータベースはmysql
、key
mysql キーワードです。
しかし、私のテーブルには名前の付いたファイルがありますkey
そして、アクションを実行すると、エラーが発生しました:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key FROM `locations`' at line 1: SELECT key FROM `locations`
それで、私は何をすべきですか?