Displaying 1 result from an estimated 1 matches for "theresourc".
Did you mean:
theresource
2006 Jun 23
7
find_by_sql, can''t print results
I am a little stuck with getting an sql result into my page. I want to
run a select distinct that returns all of the different sections
available and displays this as a form select. In my controller I have:
def edit
@resource = Resource.find(params[:id])
@sections = Resource.find_by_sql "SELECT DISTINCT
resources.section FROM resources"
end
And then in my view I have:
<%