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