In my controller I have:
@pakkes = Pakke.where(\"navn like ?\", \"%#{params[:q]}%\") respond_to do |format| format.html # index.html.erb format.xml {
Override the as_json method. It's used by to_json in order to produce the output. You can do something like:
to_json
def as_json options={} { name: navn, .... # other attributes you want to add to json } end