i am trying to paginate a custom join query but the following breaks:
@node_pages, @nodes = paginate(:nodes, :join => ["left join models
on nodes.model_id = models.id left join manufacturers on
models.manufacturer_id = manufacturers.id where manufacturers.id = ?",
@mfg_id], :per_page => 1)
however the following works:
@node_pages, @nodes = paginate(:nodes, :join => ["left join models
on nodes.model_id = models.id left join manufacturers on
models.manufacturer_id = manufacturers.id where manufacturers.id =
''#{@mfg_id}'' "], :per_page => 1)
any reason ?
I got the
Syntax error in query near "where manufacturers.id = ?3" ..
not sure why it wont interpret that ? for variable substitution but
its breaking.
thanks
adam