I'm trying to join 2 tables with ruby on rails 3.2.
rails generate model product name:string
rails generate model price product_id:integer price:integer
class Product < ActiveRecord::Base
class Price < ActiveRecord::Base
What is the most efficient way to get all products including the latest
price into the View.
Some tries didnt work for this:
@test = Product.includes(:prices).all
I didnt find anything about the prices in @test.
Thanks for help!