Skip to content

Instantly share code, notes, and snippets.

@andrellima
Created January 27, 2011 01:28
Show Gist options
  • Save andrellima/797891 to your computer and use it in GitHub Desktop.
Save andrellima/797891 to your computer and use it in GitHub Desktop.
<h3>Generos</h3>
<ul class="squared">
<% @generos.each do |genero| %>
<li><%= link_to_unless_current genero.nome, livros_path(:genero_id => genero.id) %></li>
<% end %>
</ul>
Livraria::Application.routes.draw do
resources :dvds
resources :cds
resources :livros
resources :generos do
resources :livros
end
controller livros#show
def show
@livro = Livro.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @livro }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment