Sha256: 94bded05bc59779f3424aa48d79f399609baf5ae2a734bdaece40fc54e14a2ab
Contents?: true
Size: 281 Bytes
Versions: 12
Compression:
Stored size: 281 Bytes
Contents
module EgovUtils class TownsController < ApplicationController def index selected = EgovUtils::Address.towns.lazy.select do |town| /\A#{params[:term]}/i.match?(town.name) end.first(10) render json: { towns: selected.map(&:to_h) } end end end
Version data entries
12 entries across 12 versions & 1 rubygems