brewery ui simplification

git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@49 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7
master
andrew 2007-12-03 08:38:47 +00:00
parent 0ad871e748
commit afa8015bfa
3 changed files with 10 additions and 20 deletions

View File

@ -5,7 +5,7 @@ module BreweriesHelper
end
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 }
end

View File

@ -1,23 +1,12 @@
<ul>
<% unless @breweries.empty? -%>
<table>
<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>
<% for brewery in @breweries %><li><%= show_brewery_link(brewery) -%></li><% end -%>
<% else -%>
<p>No breweries, yet.</p>
<li>No breweries, yet.</li>
<% end -%>
</ul>
<%= render :partial => 'shared/pagination_links' %>
<% content_for :sidebar do -%>
<%= link_to 'New brewery', new_brewery_path -%><br />

View File

@ -1,6 +1,7 @@
<%= render :partial => 'pages/page' %>
<% content_for :sidebar do -%>
<%= link_to 'New Brewery', new_brewery_path -%><br />
<%= link_to 'Edit', edit_brewery_path(@brewery.page.title_for_url) -%><br />
<%= new_brewery_link -%><br />
<%= edit_brewery_link(@brewery) -%><br />
<%= link_to 'Destroy', brewery_path(@brewery.page.title_for_url), :confirm => 'Are you sure?', :method => :delete %><br />
<% end -%>