Hello Group, I''ve tried various ways to solve my problem with no luck. I have a loop that creates a string based upon a database @markerstring << "#{spot.id} => @markers[#{spot.id}]" this creates the correct string I am then using the ym4r library(http://thepochisuperstarmegashow.com/ ProjectsDoc/ym4r_gm-doc/) to create a markergroup with a function that creates some javascript. Like so, @map.overlay_global_init(GMakerGroup.new(true,@markerstring),"MyGroup") ^^^^ This doesn''t work but the following does: @map.overlay_global_init(GMakerGroup.new(true, 1 => @markers[1],2 => @markers[2]),"MyGroup") so I''m assuming that it is passing "@markerstring" rather than the contents of the VAR @markersting as an option, thus the operation fails...... Any ideas what I''m doing wrong? Or how I can dynamically compile a options string??? Thanks! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Nov 28, 2007 5:25 PM, Jay <jay.doo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> @map.overlay_global_init(GMakerGroup.new(true,@markerstring),"MyGroup")I''m not sure what you''re trying to do exactly but usually you pass a hash to new(), something like: GMakerGroup.new( :foo => true, :bar => @markerstring ) -- Greg Donald http://destiney.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Basically I''m wondering why @string = ":foo => true, :bar =>@markerstring" GMakerGroup.new(@string) is not equal to GMakerGroup.new( :foo => true, :bar => @markerstring ) that is all, why is my string being interpreted as "@string" rather than its contents??? On Nov 29, 8:23 am, "Greg Donald" <gdon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 28, 2007 5:25 PM, Jay <jay....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > @map.overlay_global_init(GMakerGroup.new(true,@markerstring),"MyGroup") > > I''m not sure what you''re trying to do exactly but usually you pass a > hash to new(), something like: > > GMakerGroup.new( :foo => true, :bar => @markerstring ) > > -- > Greg Donaldhttp://destiney.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 29 Nov 2007, at 19:18, Jay wrote:> > Basically I''m wondering why > > @string = ":foo => true, :bar =>@markerstring" > > GMakerGroup.new(@string) > > is not equal to > > GMakerGroup.new( :foo => true, :bar => @markerstring ) > > that is all, why is my string being interpreted as "@string" rather > than its contents???Strings aren''t hashes. There is no "interpretation" going on when you pass @string to GMakerGroup, it''s just a string There''s no reason why those 2 things should be equivalent. Fred> > > > On Nov 29, 8:23 am, "Greg Donald" <gdon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> On Nov 28, 2007 5:25 PM, Jay <jay....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> @map >>> .overlay_global_init(GMakerGroup.new(true,@markerstring),"MyGroup") >> >> I''m not sure what you''re trying to do exactly but usually you pass a >> hash to new(), something like: >> >> GMakerGroup.new( :foo => true, :bar => @markerstring ) >> >> -- >> Greg Donaldhttp://destiney.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---