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
dc31b2a3
Commit
dc31b2a3
authored
Aug 21, 2022
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新生成的代码格式,string使用单引号
parent
0d7be6d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
_detail.json.jbuilder
...s/simple_controller/templates/views/_detail.json.jbuilder
+1
-1
_simple.json.jbuilder
...s/simple_controller/templates/views/_simple.json.jbuilder
+1
-1
show.json.jbuilder
...tors/simple_controller/templates/views/show.json.jbuilder
+1
-1
No files found.
lib/generators/simple_controller/templates/views/_detail.json.jbuilder
View file @
dc31b2a3
json.partial!
"<%= view_path %>/simple"
, <%= resource_singular %>: <%= resource_singular %>
json.partial!
'<%= view_path %>/simple'
, <%= resource_singular %>: <%= resource_singular %>
lib/generators/simple_controller/templates/views/_simple.json.jbuilder
View file @
dc31b2a3
json.partial!
"<%= view_path %>/single"
, <%= resource_singular %>: <%= resource_singular %>
json.partial!
'<%= view_path %>/single'
, <%= resource_singular %>: <%= resource_singular %>
<%- belongs_to_refs.each do |ref| -%>
json.<%= ref.name.to_s %> <%= resource_singular %>.<%= ref.name.to_s %>, partial: '<%= File.join(ref.klass.name.underscore.pluralize, 'single') %>', as: :<%= ref.name %>
...
...
lib/generators/simple_controller/templates/views/show.json.jbuilder
View file @
dc31b2a3
json.partial!
"detail"
, <%= resource_singular %>: @<%= resource_singular %>
json.partial!
'detail'
, <%= resource_singular %>: @<%= 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