Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to show sql result on server console
- ActiveRecord::Base.connection.execute("select count(*) from cars;")
- rslt = ActiveRecord::Base.connection.execute("select count(*) from cars;")
- p rslt
- rslt = ActiveRecord::Base.connection.execute("select count(*) from cars;")
- rslt.each {|mysql_result| puts mysql_result}
- class HomeController < ActionController::Base
- def index
- rslt = ActiveRecord::Base.connection.execute("select count(*) from cars;")
- logger.info "#{rslt}"
- end
- end
Add Comment
Please, Sign In to add comment