rails 3 - SQL pass variable to "order" -


I'm trying to pass the variable in order ...

  [code ] .order ([(Prices.Price *?) + Profile .PippingCost), Parameter [: Prod_ID]]. All   

but this variable does not convert to SQL in exchange, it gives me (In this case the variable was "1").

  Group by Price Order by SUM (Prices.Price *?) + Profiles.shippingCost), 1):   

Is this possible?

You can:

  [code] .order ( "SUM (prices.price * # {params [: prod_id] .to_i}) + profiles.shippingCost)". All.    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -