2
I created a scaffold called a book and I wanted to create a method to count how many book entries there are in my database and use that result in the controller of another scaffold, called the bulletin board, where it will show the total of books, total loans and loans due
Note: Learning Rails and picking up a bit with the syntax.
already solved the problem was very simple so: inside the model of the bulletin board I put Book.Count and in the view I did <%= Book. %>
– Diego Souza
Correct Diego: <%= Book. %>
– Danilo Cândido