Sha256: 7957b88bd012ba50e5e72d18b67bc6d94881810709c6da05ff09606bc0740857
Contents?: true
Size: 618 Bytes
Versions: 8
Compression:
Stored size: 618 Bytes
Contents
module Spree module Api module V2 class StatesController < Spree::Api::V2::BaseController skip_before_action :authenticate_user def index render_collection states end def show render_instance states.find(params[:id]) end private def states @states ||= begin if params[:country_id].present? Spree::Country.find(params[:country_id]).states.includes(:country) else Spree::State.includes(:country) end end end end end end end
Version data entries
8 entries across 8 versions & 3 rubygems