Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
b271c9f1
Commit
b271c9f1
authored
Jul 28, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count方法の修正
parent
53f76cef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
10 deletions
+7
-10
app/controllers/flow_controller.rb
+0
-2
app/controllers/stock_controller.rb
+0
-2
app/views/flow/show.html.slim
+3
-3
app/views/stock/show.html.slim
+4
-3
No files found.
app/controllers/flow_controller.rb
View file @
b271c9f1
...
@@ -2,7 +2,5 @@ class FlowController < ApplicationController
...
@@ -2,7 +2,5 @@ class FlowController < ApplicationController
def
show
def
show
@posts
=
Post
.
includes
(
:tags
,
:author
).
where
(
is_draft:
false
).
order
(
updated_at: :desc
).
page
(
params
[
:page
]).
decorate
@posts
=
Post
.
includes
(
:tags
,
:author
).
where
(
is_draft:
false
).
order
(
updated_at: :desc
).
page
(
params
[
:page
]).
decorate
@users
=
User
.
all
@tags
=
Tag
.
all
end
end
end
end
app/controllers/stock_controller.rb
View file @
b271c9f1
class
StockController
<
ApplicationController
class
StockController
<
ApplicationController
def
show
def
show
@posts
=
Post
.
all
.
count
end
end
end
end
app/views/flow/show.html.slim
View file @
b271c9f1
...
@@ -3,13 +3,13 @@
...
@@ -3,13 +3,13 @@
.numbers-wrapper
.numbers-wrapper
.col-xs-4
.col-xs-4
label
.numbers
Posts
label
.numbers
Posts
p
=
@posts
.
count
p
=
Post
.
count
.col-xs-4
.col-xs-4
label
.numbers
Users
label
.numbers
Users
p
=
@users
.
count
p
=
User
.
count
.col-xs-4
.col-xs-4
label
.numbers
Tags
label
.numbers
Tags
p
=
@tags
.
count
p
=
Tag
.
count
.col-xs-8
role
=
"navigation"
.col-xs-8
role
=
"navigation"
.panel
.panel
.panel-heading
.panel-heading
...
...
app/views/stock/show.html.slim
View file @
b271c9f1
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
.panel.stock-wrapper
.panel.stock-wrapper
.panel-heading
.panel-heading
h1
h1
#odometer
.odometer
123
#odometer
.odometer
0
|
Stocks
|
Stocks
small
-
保存・蓄積された記事
small
-
保存・蓄積された記事
.panel-body
.panel-body
#sidebar
role
=
"navigation"
#sidebar
role
=
"navigation"
...
@@ -13,9 +13,10 @@
...
@@ -13,9 +13,10 @@
-
cache
(
'tag-tree'
,
:expires_in
=>
1
.
hour
)
do
-
cache
(
'tag-tree'
,
:expires_in
=>
1
.
hour
)
do
.list-group
.list-group
=
Tag
.
posts_exist
.
decorate
.
tree_view
=
Tag
.
posts_exist
.
decorate
.
tree_view
javascript:
javascript:
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
setTimeout
(
function
(){
setTimeout
(
function
(){
$
(
'.odometer'
).
html
(
#{
@posts
}
);
//数字は最後の数値
$
(
'.odometer'
).
html
(
#{
Post
.
count
}
);
//数字は最後の数値
},
1000
);
},
1000
);
});
});
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