-
Notifications
You must be signed in to change notification settings - Fork 2
f7_page
This renders the container that holds a page for an application.
f7_page options, &block
As well as all the usual HTML options, you have these extra, helper specific options:
-
:layout
- Optional, allows you specify a layout to render a page partial within. Ignored when used with a block. -
:padding
- Optional, specify top and bottom offsets in an array. They are both optional.- For a navbar, use one of the following:
:no_navbar
:navbar
- For a toolbar/tabbar, use one of the following:
:no_toolbar
:tabbar_labels
:toolbar
The precedence for the two
:padding
options is shown above. Only the first match will be kept. - For a navbar, use one of the following:
When you specify :no_navbar
or :no_toolbar
the navbar of that page to be rendered empty, regardless of content.
<%= f7_page :home, :padding => :tabbar_labels do %>
<!-- Other Content -->
<% end %>
<div class="page navbar-fixed" data-page="home">
<div class="page-content">
<!-- Other Content -->
</div>
</div>
If you choose not to pass a block along with this helper it will attempt to load a partial as follows:
app/views/<controller>/<view>/<page>
For example, if you have a WelcomeController
view containing the following markup:
<%= f7_views do %>
<%= f7_view :main do %>
<%= f7_pages :navbar => :through do %>
<%= f7_page :home %>
It will try and load the partial app/views/welcome/main/home
, obeying the normal rules for file extensions, etc. failing if it cannot be found.