how can i see what sql is used

Remco Hh wrote:

Can i do that in rails as wel?
Is there any way to see what sql is being submitted?

While there is probably a way to have the query echoed in your view
(I'm afraid I don't know what it would be), you can always find it in
your logs. Each time you load a view, the log will print each query
run before the view is rendered. For instance, my development.log is
full of entries like:

    ...
    [4;35;1mUser Load (0.000594)e[0m e[0mSELECT * FROM users WHERE (users.id = 2) LIMIT 1e[0m
    [4;36;1mClient Load (0.000638)e[0m e[0;1mSELECT * FROM clients WHERE (clients.id = 1) LIMIT 1e[0m
    Rendered shared/_worklog (0.00322)
    history: skipped refresh request
    Completed in 0.06709 (14 reqs/sec) | Rendering: 0.03604 (53%) | DB: 0.01685 (25%) | 200 OK [http://localhost/work_items]

~gwendy