jQuery token input on Rails [closed]
I'm trying to use the jQuery token input p开发者_开发技巧lugin with Rails and Mongoid.
Using this Railscast as a reference I added the plugin to my app and I setup the various methods, etc.
I created a method on my model that should return this data:
class TheModel
def token_inputs
{ :id => _id, :name => name }
end
end
In my controller I do this:
class TheModelsController < ApplicationController
@models = TheModel.all
respond_to do |format|
format.json { render :json => @models.map(&:token_inputs) }
end
end
It's fixed. I missed a comma in my JavaScript. Silly me.
精彩评论