Why doesn't this work!


I have this in my controller…

@tech_standards = TechStandard.find_by_sql(“SELECT * FROM tech_standards
WHERE subpoint <> 0”)

Everything is fine except when I look at my view I still get supoints
that are 0. When I run this query in my query browser I don’t.


  <% for @tech_standard in @tech_standards %>

    <option value="<%= @tech_standard.id %>"><%=

#{@tech_standard.point}.#{@tech_standard.subpoint }” %>

  <% end %>

Am I missing something?

Seth B.


Have you tried inputting this exact string using mysql utility? Are
you sure of your syntax?

Check ‘development.log’ under /log, and you can watch the query go by,
and make sure it is doing exactly what you specified.

I’d start with the mysql utility and see what data you get back first.

  • Nic.