Hi,
Been a while since I was on here, glad to see Hobo still going strong!
I am trying to manipulate the view within a table plus, and use an image
instead - this is easily achieved with
<state-view:>
<%= image_tag("icon-tick.png", :style => "vertical-align:middle", :border
=> "0") %>
</state-view:>
and then the 'state' gets the image view
However, I would like this to change depending on the 'state' (this is a
transition set up in the model)
So two states are 'passed' and 'failed'
is there a way of using conditionals to use a different image depending on
the result of the state?
i.e like this:
<table-plus:results fields="test, test.description, test.test_group, state"
without-search-form>
<state-view:>
<% if this.state == "passed" %>
<%= image_tag("icon-tick.png", :style => "vertical-align:middle", :border
=> "0") %>
<% elsif this.state == "failed" %>
<%= image_tag("icon-cross.png", :style => "vertical-align:middle",
:border => "0") %>
<% end %>
</state-view:>
Many thanks in advance
Pete
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.