PDA

View Full Version : Ruby NOT EQUAL TO?


AegisSailor
05-14-2006, 02:17 PM
Hi gang,

I've got this bit of code in a RHTML file to output all fields in the database table as edit in place fields:

<% for column in User.content_columns %>
<p>
<b><%= column.human_name %>:</b>
<%= in_place_editor_field :user, column.name, {}, :rows => 10 %>
</p>
<% end %>

That's farily straight forward. The problem is I need a way to skip the password field. That is, I don't want the password shown on the page. (It's encrypted and so gets edited via another method.)

I cannot find a single example of conditional Ruby code that looks for values that are not equal. In visual basic, I might do something like this:

Do while column.human_name <> "password"

How do I accomplish this in Ruby?

Thanks!

ben_brown30
05-15-2006, 08:15 AM
Have you tried something like "while column.human_name != "password""

I'm not a Ruby expert by any means but something along those lines should work...