Skip to content
This repository has been archived by the owner on Aug 2, 2018. It is now read-only.

Commit

Permalink
Add a fixed footer.
Browse files Browse the repository at this point in the history
  • Loading branch information
technicalpickles committed Dec 9, 2010
1 parent 6b90483 commit 6556259
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/helpers/application_helper.rb
Expand Up @@ -19,4 +19,13 @@ def page_title
def page_title=(page_title)
@page_title = page_title
end

def navigation_link_to(name, options = {}, html_options = {}, &block)
if current_page?(options)
html_options[:class] ||= ""
html_options[:class] += " ui-btn-active"
end

link_to name, options, html_options, &block
end
end
19 changes: 19 additions & 0 deletions app/views/layouts/application.mobile.erb
Expand Up @@ -16,6 +16,25 @@
<div data-role="content">
<%= yield %>
</div>

<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>
<%= navigation_link_to 'Home', root_path %>
</li>
<% if signed_in? -%>
<li>
<%= link_to 'My Scotch Log', current_user %>
</li>
<% else %>
<li><%= link_to "Sign up", sign_up_path(:return_to => request.path) %></li>
<% end -%>
<li><%= link_to 'Scotches', scotches_path %></li>
<li><%= link_to 'Enthusiasts', users_path %></li>
</ul>
</div>
</div>
</div>
</body>
</html>

0 comments on commit 6556259

Please sign in to comment.