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
ed132273
Commit
ed132273
authored
Aug 08, 2020
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use records instead of resource_plural
parent
a3a23dea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
spec.rb.tt
lib/generators/simple_controller/templates/specs/spec.rb.tt
+1
-1
index.json.jbuilder
...ors/simple_controller/templates/views/index.json.jbuilder
+1
-1
No files found.
lib/generators/simple_controller/templates/specs/spec.rb.tt
View file @
ed132273
...
@@ -71,7 +71,7 @@ resource_singular %>_ref
...
@@ -71,7 +71,7 @@ resource_singular %>_ref
<% elsif details[:summary].start_with?("list") -%>
<% elsif details[:summary].start_with?("list") -%>
it {
it {
body = JSON.parse(response.body)
body = JSON.parse(response.body)
expect(body['
<%= resource_plural %>
'].count).to eq @<%= resource_model_singular %>_count
expect(body['
records
'].count).to eq @<%= resource_model_singular %>_count
}
}
<% elsif details[:summary].start_with?("delete") -%>
<% elsif details[:summary].start_with?("delete") -%>
it {
it {
...
...
lib/generators/simple_controller/templates/views/index.json.jbuilder
View file @
ed132273
...
@@ -2,4 +2,4 @@ json.current_page @<%= resource_plural %>.current_page
...
@@ -2,4 +2,4 @@ json.current_page @<%= resource_plural %>.current_page
json.total_pages @<%= resource_plural %>.total_pages
json.total_pages @<%= resource_plural %>.total_pages
json.total_count @<%= resource_plural %>.count
json.total_count @<%= resource_plural %>.count
json.
<%= resource_plural %>
@<%= resource_plural %>, partial: '<%= view_path %>/simple', as: :<%= resource_singular %>
json.
records
@<%= resource_plural %>, partial: '<%= view_path %>/simple', as: :<%= resource_singular %>
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