def index
    @fields = Field.where("name like ?", "%#{params[:q]}%")
    respond_to do |format|
      format.html # index.html.erb
      format.json { render :json => @fields.map(&:attributes) }