On 6 Oct 2008, at 16:41, Brad Symons wrote:

>

> when i run this with debug
>
> <%= debug Result.find(:all, :conditions => 'resulttype = (select
> resulttype from results where id = 1)') %>
>
> i get:
> resulttype = 'pass'
> id = '1'
>
> but when i remove debuy, i just get ####, adding a h, like this
> <%= h Result.find(:all, :conditions => 'resulttype = (select  
> resulttype
> from results where id = 1)') %>
>
> i get #<Result:0x395f080>
>

<%= %> just calls to_s on the result inside it. The to_s on an array  
is just the concatenation of the result of to_s on the elements of the  
array, and the default to_s on an AR object is unhelpful. It's up to  
you do to something like

<% @some_results.each do |result|
   date: <%= result.created_at %>
   value: <%= result.value %>
...
<% end %>

> can anyone point me to a good source to understand more about  
> the :find,
> because its quite obscure on the rails reference.
>
>
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to