Sha256: 089ad49ac6cd3d7058e3c97cbb3f0a776f0ab7b6d499f647df8d3fe43da264ef
Contents?: true
Size: 477 Bytes
Versions: 8
Compression:
Stored size: 477 Bytes
Contents
class Admin::SectionsController < Admin::BaseController belongs_to :site respond_to :html respond_to :json, :only => :update before_filter :protect_last_section, :only => :destroy helper :sections abstract_actions :except => [:index, :destroy] purges :destroy protected def protect_last_section if site.sections.count == 1 resource.errors[:error] = [:last_section_cant_be_destroyed] respond_with(resources) end end end
Version data entries
8 entries across 8 versions & 1 rubygems