I have the following method an ROR application.
query_student = "SELECT name, registration, room FROM students WHERE registration = "+
params[:registration]+" AND password = "+params[:password]
@student = ActiveRecord::Base.connection.execute(query_student)
render :json => @student
It seems to me that in OOP it would not be legal to keep the query in CONTROLLER.
Does anyone know how I could throw this query to model and just instantiate and tals?