When ERB compiles your view, the result is a string. If I remember
correctly, the to_s method is invoked on objects, which in this case
results in the string that you are seeing. You need to pass in an
identifier that can be used to look up the specific instance of
HsdPair, or alternatively, use a low cost db like sqlite and pass in
the id.

On Sep 24, 1:42 pm, Luke Lukas <rails-mailing-l...@andreas-s.net>
wrote:
> I have a model that looks like this (with various other methods)
>
> class HsdPair
>   attr_accessor :hsd
>
>   def initialize(hsd)
>     @hsd = hsd
>     @current_display = 0
>     @has_changed_flag = false
>   end
> end
>
> After initializing this object in the controller
>
> @hsd_pairs = HsdPair.new(@job.hsd_pairs)
>
> using it in the view various times and in various ways, when I try to
> pass this object back to the controller for various ajax interactions
> like so:
>   <%= link_to_remote image_tag("right-arrow.png", :size => "48x48"),
> :url => {
>     :action => "hsd_forward",
>     :hsd_pairs => hsd_pairs },
>     :with => "'update='+$('current_display').value" %>
>
> it shows up as being passed as a string:
>
> Parameters:
> {"authenticity_token"=>"UGj1tJruzDdzBGexIZCLyYluQINn2Wl9pADFQ7G1SY4=",
> "hsd_pairs"=>"#<HsdPair:0xb1c4fc14>", "update"=>"0"}
>
> Any idea on how to solve this or to get the data back from that pointer?
> Thanks.
>
> Alternatively, does anyone know if PassiveRecord solves this problem?
> --
> Posted viahttp://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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to