Sha256: a1da103d9b016e359610bec724b28170c23ac79c8bf46ab78ed69161d1e946e3
Contents?: true
Size: 670 Bytes
Versions: 9
Compression:
Stored size: 670 Bytes
Contents
class Admin::StatesController < Admin::BaseController resource_controller belongs_to :country before_filter :load_data index.response do |wants| wants.html wants.js do render :partial => 'state_list.html.erb' end end new_action.response do |wants| wants.html {render :layout => !request.xhr?} end create.wants.html { redirect_to admin_country_states_url(@country) } update.wants.html { redirect_to admin_country_states_url(@country) } private def collection @collection ||= end_of_association_chain.order_by_name end def load_data @countries = Country.order_by_name end end
Version data entries
9 entries across 9 versions & 1 rubygems