brewery ui simplification
git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@49 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7master
parent
0ad871e748
commit
afa8015bfa
|
@ -5,7 +5,7 @@ module BreweriesHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_brewery_link(brewery)
|
def show_brewery_link(brewery)
|
||||||
link_to 'Show', brewery_path(brewery.page.title_for_url),
|
link_to brewery.title, brewery_path(brewery.page.title_for_url),
|
||||||
{ :title => brewery.title }
|
{ :title => brewery.title }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,12 @@
|
||||||
|
<ul>
|
||||||
<% unless @breweries.empty? -%>
|
<% unless @breweries.empty? -%>
|
||||||
<table>
|
<% for brewery in @breweries %><li><%= show_brewery_link(brewery) -%></li><% end -%>
|
||||||
<tr>
|
|
||||||
<th>Title</th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
<% for brewery in @breweries %>
|
|
||||||
<tr>
|
|
||||||
<td><%= brewery.title -%></td>
|
|
||||||
<td><%= link_to 'Show', brewery_path(brewery.page.title_for_url) %></td>
|
|
||||||
<td><%= link_to 'Edit', edit_brewery_path(brewery.page.title_for_url) %></td>
|
|
||||||
<td><%= link_to 'Destroy', brewery_path(brewery.page.title_for_url), :confirm => 'Are you sure?', :method => :delete %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</table>
|
|
||||||
<% else -%>
|
<% else -%>
|
||||||
<p>No breweries, yet.</p>
|
<li>No breweries, yet.</li>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<%= render :partial => 'shared/pagination_links' %>
|
||||||
|
|
||||||
<% content_for :sidebar do -%>
|
<% content_for :sidebar do -%>
|
||||||
<%= link_to 'New brewery', new_brewery_path -%><br />
|
<%= link_to 'New brewery', new_brewery_path -%><br />
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<%= render :partial => 'pages/page' %>
|
<%= render :partial => 'pages/page' %>
|
||||||
|
|
||||||
<% content_for :sidebar do -%>
|
<% content_for :sidebar do -%>
|
||||||
<%= link_to 'New Brewery', new_brewery_path -%><br />
|
<%= new_brewery_link -%><br />
|
||||||
<%= link_to 'Edit', edit_brewery_path(@brewery.page.title_for_url) -%><br />
|
<%= edit_brewery_link(@brewery) -%><br />
|
||||||
|
<%= link_to 'Destroy', brewery_path(@brewery.page.title_for_url), :confirm => 'Are you sure?', :method => :delete %><br />
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
Reference in New Issue