Reputation: 2985
I would like to know whether there is a way of viewing the sql submitted when the 'Submit' button is clicked in a rails form.
Thanks for any suggestion provided.
Upvotes: 1
Views: 112
Reputation: 2805
Look in the log/development.rb file - you should be able to see the SQL of every request if you are in dev.
If you are in the console, enter this command at the start:
ActiveRecord::Base.logger = Logger.new(STDOUT)
And you the log comments will be output to your screen.
Upvotes: 1
Reputation:
On my installation the sql statements are dumped into the development log (or the output of 'rails server'...
Upvotes: 1
Reputation: 654
The test log will show all database queries performed
tail -f log/test.log
Upvotes: 1