using flash to display empty model set
git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@100 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7master
parent
4de6c9a57a
commit
68e9d000de
|
@ -9,6 +9,9 @@ class BeersController < ApplicationController
|
||||||
@secondary_title = 'Browsing all beers'
|
@secondary_title = 'Browsing all beers'
|
||||||
@pages, @beers = paginate :beers, :include => 'page', :per_page => per_page,
|
@pages, @beers = paginate :beers, :include => 'page', :per_page => per_page,
|
||||||
:order => 'beers.title ASC'
|
:order => 'beers.title ASC'
|
||||||
|
if @beers.empty?
|
||||||
|
flash.now[:notice] = 'There are no beers yet.'
|
||||||
|
end
|
||||||
@tags = Page.tags(:limit => 25, :order => "name DESC",
|
@tags = Page.tags(:limit => 25, :order => "name DESC",
|
||||||
:owner_type => 'Beer')
|
:owner_type => 'Beer')
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
|
@ -9,10 +9,11 @@ class BreweriesController < ApplicationController
|
||||||
@secondary_title = 'Browsing all breweries'
|
@secondary_title = 'Browsing all breweries'
|
||||||
@pages, @breweries = paginate :breweries, :include => 'page',
|
@pages, @breweries = paginate :breweries, :include => 'page',
|
||||||
:order => 'breweries.title ASC', :per_page => per_page
|
:order => 'breweries.title ASC', :per_page => per_page
|
||||||
|
if @breweries.empty?
|
||||||
|
flash.now[:notice] = 'There are no breweries yet.'
|
||||||
|
end
|
||||||
@tags = Page.tags(:limit => 25, :order => "name DESC",
|
@tags = Page.tags(:limit => 25, :order => "name DESC",
|
||||||
:owner_type => 'Beer')
|
:owner_type => 'Beer')
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.rhtml
|
format.html # index.rhtml
|
||||||
format.xml { render :xml => @breweries.to_xml }
|
format.xml { render :xml => @breweries.to_xml }
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
<ul>
|
<ul>
|
||||||
<% unless @beers.empty? -%>
|
<% for beer in @beers %><li><%= link_to beer.title, beer_path(beer.page.title_for_url) %></li><% end %>
|
||||||
<% for beer in @beers %><li><%= link_to beer.title, beer_path(beer.page.title_for_url) %></li><% end -%>
|
|
||||||
<% else -%>
|
|
||||||
<li>No beers, yet</li>
|
|
||||||
<% end -%>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= render :partial => 'shared/pagination_links' %>
|
<%= render :partial => 'shared/pagination_links' %>
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
<ul>
|
<ul>
|
||||||
<% unless @breweries.empty? -%>
|
|
||||||
<% for brewery in @breweries %><li><%= show_brewery_link(brewery) -%></li><% end -%>
|
<% for brewery in @breweries %><li><%= show_brewery_link(brewery) -%></li><% end -%>
|
||||||
<% else -%>
|
|
||||||
<li>No breweries, yet.</li>
|
|
||||||
<% end -%>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= render :partial => 'shared/pagination_links' %>
|
<%= render :partial => 'shared/pagination_links' %>
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
<ul>
|
<ul>
|
||||||
<% unless @peoples.empty? -%>
|
|
||||||
<% for people in @peoples -%><li><%= show_people_link(people) -%></li><% end %>
|
<% for people in @peoples -%><li><%= show_people_link(people) -%></li><% end %>
|
||||||
<% else -%>
|
|
||||||
<li>No people, yet!</li>
|
|
||||||
<% end -%>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= render :partial => 'shared/pagination_links' %>
|
<%= render :partial => 'shared/pagination_links' %>
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
<ul>
|
<ul>
|
||||||
<% unless @roles.empty? -%>
|
<% for role in @roles -%><li><%= show_role_link(role) -%></li><% end %>
|
||||||
<% for role in @roles %>
|
|
||||||
<li><%= show_role_link(role) -%></li>
|
|
||||||
<% end %>
|
|
||||||
<% else -%>
|
|
||||||
<li>No roles, yet.</li>
|
|
||||||
<% end -%>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% content_for :sidebar do -%>
|
<% content_for :sidebar do -%>
|
||||||
|
|
Reference in New Issue