In my controller I have:
在我的控制器中,我有:
@pakkes = Pakke.where("navn like ?", "%#{params[:q]}%")
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @pakkes }
format.json { render :json => @pakkes.map(&:attributes) }
end
@pakke