SQL and Rails

asked Jul 6, 2013 in General by redBee (760 points)
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 like 0 dislike
answered Jul 6, 2013 by TopNet (10,360 points)
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’)