def tag_autocomplete
@tags = Tag.find_by_sql("SELECT tag_name as id,tag_name as label,tag_name as value FROM tags ")
render :json => @tags.to_json
end
渲染JSON不工作我收到以下錯誤渲染JSON錯誤
ArgumentError (wrong number of arguments (0 for 2)):
/app/controllers/tags_controller.rb:32:in `to_json'
我使用Ruby 1.8.6和軌道提前
你的標籤模塊是怎樣的? –
你是否有機會重寫'Tag'模型中的'to_json'方法? – rubyprince