Skip to content

Commit 5820aa1

Browse files
committed
refactored menu into partial, removed inline javascript
1 parent 427f5ae commit 5820aa1

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

app/views/layouts/application.html.haml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@
88
= csrf_meta_tags
99
%body
1010
= render "shared/menu/user"
11-
.flash #{flash[:notice]}
11+
= render "shared/menu/main"
12+
13+
- if flash[:notice]
14+
.flash #{flash[:notice]}
15+
16+
= yield :links
1217
= yield
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
:javascript
2-
$(document).ready(function(){
3-
$('#ask_button').click(
4-
function(){
5-
$('#the_form').show();
6-
$('#ask_button').remove();
7-
});
8-
});
91
- content_for :title do
102
Questions
113

@@ -23,7 +15,3 @@
2315
%th
2416

2517
= render :partial => "list", :collection => collection
26-
%div#the_form{:style=>'display:none'}
27-
= render "form"
28-
- if current_user
29-
%h3#ask_button Ask a question
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= semantic_menu do |root|
2+
- root.add "Home", root_path
3+
- root.add "Questions", questions_path

app/views/static/root.html.haml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
%h1 Home!
2-
%a(href="/questions") Q&A

0 commit comments

Comments
 (0)