series of author

This commit is contained in:
Meutel 2015-08-15 16:04:35 +02:00
parent d08fb8c456
commit 765c8c31d7
4 changed files with 13 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class AuthorsController < ApplicationController
end
def series
@author = Author.find(params[:id])
@series = Serie.find_by_sql(["select distinct s.* from series s left outer join books_series_link bsl on bsl.series = s.id left outer join books_authors_link bal on bal.book = bsl.book where bal.author = ?", params[:id]])
respond_to do |format|
format.html
format.js

View File

@ -1 +1,6 @@
TODO
<h2><%= t(:author_serie, count: @series.count) %></h2>
<ul>
<% @series.each do |s| %>
<li><%= link_to s.name, s %></li>
<% end %>
</ul>

View File

@ -50,6 +50,9 @@ en:
author_coauthor:
one: "Co-Author"
other: "Co-Authors"
author_serie:
one: "Serie"
other: "Series"
will_paginate:
previous_label: "&#8592; Previous"
next_label: "Next &#8594;"

View File

@ -50,6 +50,9 @@ fr:
author_coauthor:
one: "Co-Auteur"
other: "Co-Auteurs"
author_serie:
one: "Serie"
other: "Series"
will_paginate:
previous_label: "&#8592; Précédent"
next_label: "Suivant &#8594;"