Commit a701ca29 by liyijie

feat: 增加importable_class 和 exportable_class 的默认类

parent 60da8657
...@@ -117,8 +117,8 @@ class SimpleController::BaseController < ::InheritedResources::Base ...@@ -117,8 +117,8 @@ class SimpleController::BaseController < ::InheritedResources::Base
self.class_attribute :importable_class, instance_writer: false unless self.respond_to? :importable_class self.class_attribute :importable_class, instance_writer: false unless self.respond_to? :importable_class
self.class_attribute :exportable_class, instance_writer: false unless self.respond_to? :exportable_class self.class_attribute :exportable_class, instance_writer: false unless self.respond_to? :exportable_class
self.importable_class = options.delete(:importable_class) || self.resource_class self.importable_class = options.delete(:importable_class) || self.name.sub(/Controller$/, 'Excel').safe_constantize || self.resource_class
self.exportable_class = options.delete(:exportable_class) || self.resource_class self.exportable_class = options.delete(:exportable_class) || self.name.sub(/Controller$/, 'Excel').safe_constantize || self.resource_class
set_view_path view_path if view_path.present? set_view_path view_path if view_path.present?
super(options) super(options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment