My _footer.html.erb
is (simplified):
<footer class="footer">
<nav class="navbar navbar-default navbar-fixed-bottom navbar-inverse">
<% if logged_in? %>
<li class="btn btn-primary"> <%= link_to 'Add New Connection', new_year_path %></li>
<li class="btn btn-primary"> <%= link_to 'Add New Person', new_person_path %> </li>
<li class="btn btn-primary"> <%= link_to 'Add New Address/Location', new_location_path %> </li>
<% end %>
</nav>
</footer>
But I don't want the footer to show up while editing; too easy to click on one of these buttons instead of Cancel
or Submit
which is down the page and my footer is stuck to the bottom. views/layouts/application.html.erb
has <%= render 'layouts/footer' %>
I suppose I could have my three edit.html.erg
s not use the defaults above, but seems easier if I could add another condition on the _footer.html.erg
. Or some other way. Maybe something about leaving page without submitting?
Based on @tsrandrei comment I tried wrapping the footer in <% if !current_page?(action: 'edit') %>
blah-blah <% end %>
but then get error No route matches {:action=>"edit", :controller=>"…"}
with the controller name being whatever the page is relevant to.