I get an error while using find_all_by_
controller
@books = Book.find_by_author_id(4)
View
<%= @books.name %>
This works. But when I replace find_by_ with find_all_by_ I get this error
undefined method `name'
I want to use find_all_by_ to fetch all the books corresponding to author_id=4
you are getting an
Arrayof records. AndArraydoes not have thenamemethod.