Sha256: 242c25c29c301e75b206f285f40504360c1901299895718dadf855d58998e27a
Contents?: true
Size: 930 Bytes
Versions: 54
Compression:
Stored size: 930 Bytes
Contents
# encoding: utf-8 class MagicAddresses::StatesController < MagicAddresses::BaseController def index order_locales = [ I18n.locale ] order_locales << :en unless I18n.locale == :en @states = ::MagicAddresses::State.includes(:translations).with_translations(order_locales).order( 'mgca_state_translations.name ASC' ) # @states = ::MagicAddresses::State.includes(:translations).with_translations(I18n.locale).order( 'mgca_state_translations.name ASC' ) # @states = ::MagicAddresses::State.includes(:translations).order("mgca_state_translations.name ASC") @states = ::MagicAddresses::State.includes(:translations).order(short_name: :asc) end private # Never trust parameters from the scary internet, only allow the white list through. def instance_params params.require(:state).permit(:name, :default_name, :short_name, :translations_attributes => [:id, :name, :locale]) end end
Version data entries
54 entries across 54 versions & 1 rubygems