From: yudi Date: 2007-12-13T10:21:11+09:00 Subject: Re: Inject SQL Statement in Rails ------=_Part_29610_24201197.1197508869678 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Check RailsEnvy for an ActiveRecord tutorial. You'll find everything you need over therehttp://www.railsenvy.com/2007/8/8/activerecord-tutorial On Dec 12, 2007 6:30 PM, Jojo Mojo wrote: > yudi wrote: > > You can use find_by_sql to use MySQL directly: > > > > @object.find_by_sql("SELECT course_id > > FROM degrees > > WHERE programme_id = 1 > > ") > > > > @object will be referenced with an array of entries from database. > > okay so i put this statement in the model right? > > just curious, how does the view/controller know where to find this? > -- > Posted via http://www.ruby-forum.com/. > > -- Do not be afraid of Change. ------=_Part_29610_24201197.1197508869678--