Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
4635a8c2
Commit
4635a8c2
authored
13 years ago
by
Gregor Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
[#416] using a simpler approach to replace node with partial
parent
e3f54d47
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/watchers_controller.rb
+1
-7
1 addition, 7 deletions
app/controllers/watchers_controller.rb
with
1 addition
and
7 deletions
app/controllers/watchers_controller.rb
+
1
−
7
View file @
4635a8c2
...
@@ -86,10 +86,6 @@ private
...
@@ -86,10 +86,6 @@ private
replace_selectors
=
[
'#watcher'
]
replace_selectors
=
[
'#watcher'
]
end
end
watcher_partial
=
lambda
do
render_to_string
(
:partial
=>
'watchers/watchers'
,
:locals
=>
{
:watched
=>
@watched
})
end
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
{
redirect_to
:back
}
format
.
html
{
redirect_to
:back
}
format
.
js
do
format
.
js
do
...
@@ -99,9 +95,7 @@ private
...
@@ -99,9 +95,7 @@ private
case
selector
case
selector
when
'#watchers'
when
'#watchers'
page
.
select
(
'#watchers'
).
each
do
|
node
|
page
.
replace_html
'watchers'
,
:partial
=>
'watchers/watchers'
,
:locals
=>
{
:watched
=>
@watched
}
node
.
update
watcher_partial
.
call
end
else
else
page
.
select
(
selector
).
each
do
|
node
|
page
.
select
(
selector
).
each
do
|
node
|
options
=
{
:replace
=>
replace_selectors
}
options
=
{
:replace
=>
replace_selectors
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment