Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails_dingtalk
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
other
rails_dingtalk
Commits
85080706
Commit
85080706
authored
Sep 05, 2021
by
mingyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enum
parent
67cff799
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
27 deletions
+16
-27
apps_controller.rb
app/controllers/dingtalk/admin/apps_controller.rb
+4
-13
normal_app.rb
app/models/app/dingtalk/normal_app.rb
+4
-0
_edit_form.html.erb
app/views/dingtalk/admin/apps/_edit_form.html.erb
+0
-4
_form.html.erb
app/views/dingtalk/admin/apps/_form.html.erb
+0
-6
_new_form.html.erb
app/views/dingtalk/admin/apps/_new_form.html.erb
+0
-4
zh.enum.yml
config/locales/zh.enum.yml
+8
-0
No files found.
app/controllers/dingtalk/admin/apps_controller.rb
View file @
85080706
module
Dingtalk
module
Dingtalk
class
Admin
::
AppsController
<
Admin
::
BaseController
class
Admin
::
AppsController
<
Admin
::
BaseController
before_action
:set_new_app
,
only:
[
:new
,
:create
]
before_action
:set_app
,
only:
[
:show
,
:edit
,
:update
,
:destroy
]
def
index
def
index
@apps
=
App
.
page
(
params
[
:page
])
@apps
=
App
.
page
(
params
[
:page
])
end
end
private
private
def
set_app
def
app_permit_params
@app
=
App
.
find
(
params
[
:id
])
[
end
:type
,
def
set_new_app
@app
=
App
.
new
(
app_params
)
end
def
app_params
params
.
fetch
(
:app
,
{}).
permit
(
:name
,
:name
,
:corp_id
,
:corp_id
,
:agent_id
,
:agent_id
,
:app_key
,
:app_key
,
:app_secret
:app_secret
)
]
end
end
end
end
...
...
app/models/app/dingtalk/normal_app.rb
0 → 100644
View file @
85080706
module
Dingtalk
class
NormalApp
<
App
end
end
app/views/dingtalk/admin/apps/_edit_form.html.erb
deleted
100644 → 0
View file @
67cff799
<%=
form_with
model:
@app
,
url:
{
action:
'update'
}
do
|
f
|
%>
<%=
render
partial:
'form'
,
locals:
{
f:
f
}
%>
<%=
f
.
submit
%>
<%
end
%>
app/views/dingtalk/admin/apps/_form.html.erb
deleted
100644 → 0
View file @
67cff799
<%=
render
'error_messages'
,
target:
f
.
object
%>
<%=
f
.
text_field
:name
%>
<%=
f
.
text_field
:corp_id
%>
<%=
f
.
text_field
:agent_id
%>
<%=
f
.
text_field
:app_key
%>
<%=
f
.
text_field
:app_secret
%>
app/views/dingtalk/admin/apps/_new_form.html.erb
deleted
100644 → 0
View file @
67cff799
<%=
form_with
model:
@app
,
url:
{
action:
'create'
}
do
|
f
|
%>
<%=
render
partial:
'form'
,
locals:
{
f:
f
}
%>
<%=
f
.
submit
%>
<%
end
%>
config/locales/zh.enum.yml
0 → 100644
View file @
85080706
zh
:
activerecord
:
enum
:
dingtalk/app
:
type
:
Dingtalk::NormalApp
:
普通App
Dingtalk::NewApp
:
NewApp
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