Commit 29ae1a2f by liyijie

Use BaseController instead of Base, fix the problem

parent 0980148c
class <%= controller_class_name %>Controller < SimpleController::Base
class <%= controller_class_name %>Controller < SimpleController::BaseController
view_path '<%= view_class_path %>'
<% if auth.present? %>acts_as_auth_action :<%= auth.downcase %><% end %>
......
......@@ -7,5 +7,5 @@ require 'inherited_resources'
module SimpleController
autoload :VERSION, 'simple_controller/version'
autoload :Base, 'simple_controller/base'
autoload :BaseController, 'simple_controller/base_controller'
end
class SimpleController::Base < ::InheritedResources::Base
class SimpleController::BaseController < ::InheritedResources::Base
respond_to :json
def index
......@@ -23,7 +23,7 @@ class SimpleController::Base < ::InheritedResources::Base
@view_class_path
end
# def collection
# get_collection_ivar || set_collection_ivar(end_of_association_chain.ransack(params[:q]).result.paginate(page: params[:page], per_page: params[:per_page]))
# end
def collection
get_collection_ivar || set_collection_ivar(end_of_association_chain.ransack(params[:q]).result.paginate(page: params[:page], per_page: params[:per_page]))
end
end
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