diff --git a/app/assets/javascripts/authors.coffee b/app/assets/javascripts/authors.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/authors.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/series.coffee b/app/assets/javascripts/series.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/series.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/authors.scss b/app/assets/stylesheets/authors.scss new file mode 100644 index 0000000..fb565e9 --- /dev/null +++ b/app/assets/stylesheets/authors.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the authors controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/series.scss b/app/assets/stylesheets/series.scss new file mode 100644 index 0000000..c8265b6 --- /dev/null +++ b/app/assets/stylesheets/series.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the series controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb new file mode 100644 index 0000000..533b782 --- /dev/null +++ b/app/controllers/authors_controller.rb @@ -0,0 +1,13 @@ +class AuthorsController < ApplicationController + + def show + @author = Author.find(params[:id]) + @title = @author.name + end + + def index + @authors = Author.paginate(page: params[:page]) + @title = "Authors" + end + +end diff --git a/app/controllers/series_controller.rb b/app/controllers/series_controller.rb new file mode 100644 index 0000000..eb28280 --- /dev/null +++ b/app/controllers/series_controller.rb @@ -0,0 +1,13 @@ +class SeriesController < ApplicationController + + def show + @serie = Serie.find(params[:id]) + @title = @serie.name + end + + def index + @series = Serie.paginate(page: params[:page]) + @title = "Series" + end + +end diff --git a/app/helpers/authors_helper.rb b/app/helpers/authors_helper.rb new file mode 100644 index 0000000..f22e1f9 --- /dev/null +++ b/app/helpers/authors_helper.rb @@ -0,0 +1,2 @@ +module AuthorsHelper +end diff --git a/app/helpers/series_helper.rb b/app/helpers/series_helper.rb new file mode 100644 index 0000000..57f0452 --- /dev/null +++ b/app/helpers/series_helper.rb @@ -0,0 +1,2 @@ +module SeriesHelper +end diff --git a/app/views/authors/index.html.erb b/app/views/authors/index.html.erb new file mode 100644 index 0000000..322eff1 --- /dev/null +++ b/app/views/authors/index.html.erb @@ -0,0 +1,11 @@ +
Serie: <%= @book.serie.name %>
Publisher: <%= @book.publisher.name %>
+Publishing date: <%= @book.pubdate.to_formatted_s(:date) %>
diff --git a/app/views/series/index.html.erb b/app/views/series/index.html.erb new file mode 100644 index 0000000..a2241fa --- /dev/null +++ b/app/views/series/index.html.erb @@ -0,0 +1,11 @@ +