Forum: Ruby on Rails Why doesn't this work!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Buntin, Seth - KATE (Guest)
on 2006-02-17 18:20
(Received via mailing list)
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.


<select name="resource[tech_standard]" id="tech_standard">

<option value="0" selected="selected"></option>

      <% for @tech_standard in @tech_standards %>

        <option value="<%= %>"><%=
#{@tech_standard.point}.#{@tech_standard.subpoint }" %></option>

      <% end %>


Am I missing something?

Seth B.
Nic W. (Guest)
on 2006-02-17 19:03
(Received via mailing list)
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.
This topic is locked and can not be replied to.