Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
c4667f87
Commit
c4667f87
authored
Jan 26, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Callouts controller
parent
0dab0837
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
app/controllers/callouts_controller.rb
app/controllers/callouts_controller.rb
+27
-0
config/routes.rb
config/routes.rb
+5
-0
No files found.
app/controllers/callouts_controller.rb
0 → 100644
View file @
c4667f87
class
CalloutsController
<
ApplicationController
before_action
:callout
,
only:
[
:dismiss
]
def
dismiss
respond_to
do
|
format
|
format
.
json
do
if
@callout
@callout
.
update
(
dismissed_state:
true
)
else
Callout
.
create
(
feature_name:
callout_param
,
dismissed_state:
true
,
user:
current_user
)
end
head
:ok
end
end
end
private
def
callout
@callout
=
Callout
.
find_by
(
user:
current_user
,
feature_name:
callout_param
)
end
def
callout_param
params
.
require
(
:feature_name
)
end
end
config/routes.rb
View file @
c4667f87
...
@@ -90,6 +90,11 @@ Rails.application.routes.draw do
...
@@ -90,6 +90,11 @@ Rails.application.routes.draw do
# Notification settings
# Notification settings
resources
:notification_settings
,
only:
[
:create
,
:update
]
resources
:notification_settings
,
only:
[
:create
,
:update
]
# Callouts
namespace
:callouts
do
post
:dismiss
end
draw
:google_api
draw
:google_api
draw
:import
draw
:import
draw
:uploads
draw
:uploads
...
...
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