For simplicity, am using an easy example.
I have a controller method:
def test
@books.each do |book|
@book_id = "EMI:#{book.id}"
@book_test = ....(some function)
end
end
How do I pass the '@book_id' & '@book_test' values from the loop to the view page?
Please note that I don't want to repeat the code in the view page. Just want to pass the values in the loop to the view page.