I am developing a book-author database with RoR. The book-author
relationship is many to many, therefore I created 3 tables as follows:
- writings, which has columns: id, book_id, author_id. This table
describes the relationship between the books and the authors.
I have to create a lot of “helper” methods such as
“find_coauthors(author)”, or find_books_written_by_same_authors, or
My questions is, where is the best place to put these helpers?
I have a few candidates:
- helpers/book_helper.rb -> but I can’t access them from the
controllers, can I?
- book_controllers.rb -> but can I still access it from
author_controller.rb ? can controllers access methods in each other?
- models/book.rb -> but will I have access to the author model and
What is the standard practice in this case?