How to run simple MYSQL query using rails
I want run a simple MYSQL query using rails
"Select movie-title, movie-director from moving order by rating desc limit
5;"
I don't want all the overhead creating models. I just want to run the query.
What is the best way to do this? I cannot even connect
Here is my the code from my controller
ActiveRecord::Base.establish_connection ({
:adapter => "mysql2",
:host => "some-rds.amazon.com",
:username => "root",
:password => "root",
:database => "blah"})
This will generate this error ActiveRecord::ConnectionNotEstablished
thanks
No comments:
Post a Comment