module Activatable

  def self.included(controller)
    controller.extend(ClassMethods)
  end

  module ClassMethods
    def activatable
      include Activatable::InstanceMethods
    end
  end

  module InstanceMethods
    def activate(success_block = nil)
      current_object.active = params[:active] || false
      current_object.save!
      if success_block
        success_block.call
      else
        flash[:success] = "#{current_object} #{params[:active] ? 'activated' : 'inactivated'}"
        redirect_to(objects_path)
      end
    rescue ActiveRecord::ActiveRecordError => e
      current_object.errors.add(:base, "Failed to inactivate: " + e.message)
      flash[:error] = current_object.errors.full_messages.to_sentence
      redirect_to(objects_path)
    end
  end

end

module Activatable

  def self.included(controller)
    controller.extend(ClassMethods)
  end

  module ClassMethods
    def activatable
      include Activatable::InstanceMethods
    end
  end

  module InstanceMethods
    def activate(success_block = nil)
      resource.active = params[:active] || false
      resource.save!
      if success_block
        success_block.call
      else
        flash[:success] = "#{resource} #{params[:active] ? 'activated' : 'inactivated'}"
        redirect_to(collection_path)
      end
    rescue ActiveRecord::ActiveRecordError => e
      resource.errors.add(:base, "Failed to inactivate: " + e.message)
      flash[:error] = resource.errors.full_messages.to_sentence
      redirect_to(collection_path)
    end
  end

end

Use inherited_resources methods instead of make_resourceful
Use inherited_resources methods instead of make_resourceful

 * Works with QT4 now
 * Can't update QT3 to this rails_core_extensions now
