Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
simple_controller
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
simple_controller
Commits
0980148c
Commit
0980148c
authored
Dec 28, 2017
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move base.rb to lib
parent
db5ca25d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
simple_controller.rb
lib/simple_controller.rb
+2
-6
base.rb
lib/simple_controller/base.rb
+3
-3
No files found.
lib/simple_controller.rb
View file @
0980148c
require
'rails'
require
'rails'
require
'actionpack'
require
'active_record'
require
'activerecord'
require
'activesupport'
require
'active_support/dependencies'
require
'set'
require
'responders'
require
'ransack'
require
'ransack'
require
'inherited_resources'
require
'inherited_resources'
require
'responders'
module
SimpleController
module
SimpleController
autoload
:VERSION
,
'simple_controller/version'
autoload
:VERSION
,
'simple_controller/version'
...
...
app/controllers
/simple_controller/base.rb
→
lib
/simple_controller/base.rb
View file @
0980148c
...
@@ -23,7 +23,7 @@ class SimpleController::Base < ::InheritedResources::Base
...
@@ -23,7 +23,7 @@ class SimpleController::Base < ::InheritedResources::Base
@view_class_path
@view_class_path
end
end
def
collection
#
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
]))
#
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
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment