will retrieve the status col from status. But @online is still
an ActiveRecord object.
Not quite it's an array. find :first is probably what is wanted.
You also don't need the quotes around amigo - :"collection-owner" =>
amigo would work just as well
Hi guys, thanks, I got it to work on the console..
but when I do it from the app is not working..
it says I am sending a NIL, when I hard code a username then it works..
so it has to be the way I sent the variable from the view.
<% @amigos.in_groups_of(2, false) do |grupo| %>
<tr class="<%= cycle('odd', 'even') -%>">
<% grupo.each do |amigo| %>
<td><%= image_tag isonline(amigo.jid), :alt => "Status"
%></td>
<td><%= amigo.jid %></td>
<% end %>
</tr>
<% end %>
</table>
whats wrong with isonline(amigo.jid) ???
amigo.jid works just fine in the next line..
if @online.status == "online"
@isonline = "on.png"
else
@isonline = "off.png"
end
end
please remember that you use find :all, it means that the result would
be array, when you need to see the result of each array you should
describe index key like @online[0] or @online[1] like that. Look your
code :
if @online.status == "online"
@isonline = "on.png"
else
@isonline = "off.png"
end
end
please remember that you use find :all, it means that the result would be array, when you need to see the result of each array you should describe index key like @online[0] or @online[1] like that. Look your code :