Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14361 reviews 1715 hosting providers

Questions & Answers

SQL and Rails

Jul 7, 2013 by redBee
Hello all
I am using Ruby and Rail and I am having some issues because I am unable to create all that I want without using SQL.  I need to use raw SQL, and I am not sure how can I  do this from Rails. Any help is appreciated
Many thanks

1 Answer

0 votes
Jul 7, 2013 by TopNet
1. Navigate to your rails project folder using your command prompt. type in  (cd your_path_ directory)
2. when you are in the Rails project directory, run the command.
The Rails Console will now open
3.type in the below code in the console
ActiveRecord::Base.connection.execute(‘put your SQL here’)