show book
This commit is contained in:
parent
50ece28ab6
commit
ea6326612a
3
app/assets/javascripts/books.coffee
Normal file
3
app/assets/javascripts/books.coffee
Normal file
@ -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/
|
3
app/assets/stylesheets/books.scss
Normal file
3
app/assets/stylesheets/books.scss
Normal file
@ -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/
|
7
app/controllers/books_controller.rb
Normal file
7
app/controllers/books_controller.rb
Normal file
@ -0,0 +1,7 @@
|
||||
class BooksController < ApplicationController
|
||||
|
||||
def show
|
||||
@book = Calibre::Book.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
2
app/helpers/books_helper.rb
Normal file
2
app/helpers/books_helper.rb
Normal file
@ -0,0 +1,2 @@
|
||||
module BooksHelper
|
||||
end
|
1
app/views/books/show.html.erb
Normal file
1
app/views/books/show.html.erb
Normal file
@ -0,0 +1 @@
|
||||
<h1><%= @book.title %></h1>
|
@ -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".
|
||||
|
||||
|
7
test/controllers/books_controller_test.rb
Normal file
7
test/controllers/books_controller_test.rb
Normal file
@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class BooksControllerTest < ActionController::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
Loading…
Reference in New Issue
Block a user