diff --git a/app/assets/javascripts/books.coffee b/app/assets/javascripts/books.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/books.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/books.scss b/app/assets/stylesheets/books.scss new file mode 100644 index 0000000..81379d1 --- /dev/null +++ b/app/assets/stylesheets/books.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the books 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/books_controller.rb b/app/controllers/books_controller.rb new file mode 100644 index 0000000..1a0d2cf --- /dev/null +++ b/app/controllers/books_controller.rb @@ -0,0 +1,7 @@ +class BooksController < ApplicationController + + def show + @book = Calibre::Book.find(params[:id]) + end + +end diff --git a/app/helpers/books_helper.rb b/app/helpers/books_helper.rb new file mode 100644 index 0000000..4b9311e --- /dev/null +++ b/app/helpers/books_helper.rb @@ -0,0 +1,2 @@ +module BooksHelper +end diff --git a/app/views/books/show.html.erb b/app/views/books/show.html.erb new file mode 100644 index 0000000..4afce77 --- /dev/null +++ b/app/views/books/show.html.erb @@ -0,0 +1 @@ +

<%= @book.title %>

diff --git a/config/routes.rb b/config/routes.rb index e056630..29050c8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,6 +3,8 @@ Rails.application.routes.draw do get 'static_pages/about' + resources :books + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/test/controllers/books_controller_test.rb b/test/controllers/books_controller_test.rb new file mode 100644 index 0000000..66da31d --- /dev/null +++ b/test/controllers/books_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class BooksControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end