Skip to content

Commit c9986c5

Browse files
author
Austin Schneider
committed
remove dumb menu helpers
1 parent 34cd0b1 commit c9986c5

File tree

6 files changed

+7
-37
lines changed

6 files changed

+7
-37
lines changed

app/controllers/locations_controller.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class LocationsController < ApplicationController
2-
32
respond_to :html
43

54
helper_method :location
@@ -20,8 +19,6 @@ def destroy
2019
respond_with location
2120
end
2221

23-
##################################################
24-
2522
# TODO: test
2623
def location
2724
@location ||= begin
@@ -32,5 +29,4 @@ def location
3229
end
3330
end
3431
end
35-
3632
end

app/helpers/application_helper.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ def render_paginated_locations
2929
end
3030
end
3131

32-
def main_menu
33-
[
34-
["Add URL", new_location_path],
35-
["Email callbacks", email_callbacks_path],
36-
["Alerts", alerts_path]
37-
]
38-
end
39-
40-
def email_callbacks_menu
41-
[['Add email callback', new_email_callback_path]]
42-
end
43-
4432
def alerts
4533
@alerts ||= Alert.joins { location }.order { locations.title.asc }
4634
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#email_callbacks
22
%h2 Email callbacks
33

4-
%p= render 'shared/piped_links', link_args: email_callbacks_menu
4+
%p= link_to 'Add email callback', new_email_callback_path
55

66
= render_email_callbacks

app/views/locations/index.html.haml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#locations
22
%h2 URLs
33

4-
%p= render 'shared/piped_links', link_args: main_menu
4+
%p
5+
= link_to "Add URL", new_location_path
6+
|
7+
= link_to "Email callbacks", email_callbacks_path
8+
|
9+
= link_to "Alerts", alerts_path
510

611
= render_paginated_locations
712
= paginate paginated_locations

app/views/shared/_piped_links.html.haml

Lines changed: 0 additions & 3 deletions
This file was deleted.

spec/helpers/application_helper_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,6 @@
9595
end
9696
end
9797

98-
describe "main_menu" do
99-
its :main_menu do
100-
should == [
101-
["Add URL", new_location_path],
102-
["Email callbacks", email_callbacks_path],
103-
["Alerts", alerts_path]
104-
]
105-
end
106-
end
107-
10898
describe "alerts" do
10999
context "when there are alerts" do
110100
before do
@@ -122,12 +112,6 @@
122112
end
123113
end
124114

125-
describe "email_callbacks_menu" do
126-
its :email_callbacks_menu do
127-
should == [["Add email callback", new_email_callback_path]]
128-
end
129-
end
130-
131115
describe "email_callbacks" do
132116
context "when there are email callbacks" do
133117
before do

0 commit comments

Comments
 (0)