Hey Everyone I’m caught up on some data output.
this is what i currently have:
- Make:
- <%=h vehicle.make %>
- Model:
- <%=h vehicle.model %>
- Year:
- <%=h vehicle.year %>
- Mileage:
- <%=h vehicle.mileage %>
- Price:
- <%=h vehicle.price %>
<% if vehicle.vehicle_options.drive.eql? "please_select" %>
<dt>Transmission:</dt><dd><%=h
vehicle.vehicle_options.transmission
%>
<% end %>
<% if vehicle.exterior_color.eql? "not_specified" %>
<dt>Ext Color:</dt><dd><%=h vehicle.exterior_color %></dd>
<% end %>
<% if vehicle.vehicle_options.drive.eql? "please_select" %>
<dt>Drivetrain:</dt><dd><%=h vehicle.vehicle_options.drive %></dd>
<% end %>
<% if vehicle.vehicle_options.engine_size.eql? "" %>
<dt>Engine:</dt><dd><%=h vehicle.vehicle_options.engine_size %></
dd>
<% end %>
I have some enumerated fields on creation and I don’t want to display
them in the event someone has decided not to fill them out (ie leaving
them as the default). The above does not work sadly. How can I
appropriatly check for this. I also have some boolean values as well
as possible nils(Or blank space). How can I check for these and if
theres content display it. Otherwise skip that whole field ?
I figure it should be pretty easy but everything I try fails.
Thanks, Happy Holidays !
brianp
–
You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.