Monday, June 19, 2006

Rails: Issuing direct query to database

Issue direct query to database by:

result = ''
ActiveRecord::Base.connection.execute("SELECT * from tablename;").each do |row|
result += "#{row},"
end

0 Comments:

Post a Comment

<< Home