app/controllers/maps_controller.rb
def gcps
    @map = Map.find(params[:id])
    gcps = @map.gcps_with_error(params[:soft])
    respond_to do |format|
      #format.json { render :json => gcps.to_json(:methods => :error)}
      format.json { render :json => {:stat => "ok", :items => gcps.to_a}.to_json(:methods => :error), :callback => params[:callback]}
      format.xml { render :xml => gcps.to_xml(:methods => :error)}
    end
  end
#pass in soft true to get soft gcps
pass in soft true to get soft gcps
pass in soft true to get soft gcps
def gcps
    @map = Map.find(params[:id])
    gcps = @map.gcps_with_error(params[:soft])
    respond_to do |format|
      format.json { render :json => {:stat => "ok", :items => gcps.to_a}.to_json(:methods => :error), :callback => params[:callback]}
      format.xml { render :xml => gcps.to_xml(:methods => :error)}
    end
  end
def gcps @map = Map . find ( params [ :id ] ) gcps = @map . gcps_with_error ( params [ :soft ] ) respond_to do | format | format . json { render :json => { :stat => "ok" , :items => gcps . to_a } . to_json ( :methods => :error ) , :callback => params [ :callback ] } format . xml { render :xml => gcps . to_xml ( :methods => :error ) } end end
pass in soft true to get soft gcps
pass in soft true to get soft gcps
#format.json { render :json => gcps.to_json(:methods => :error)}