Forum: Ruby on Rails bizarre problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
71cd7be67932c4ef1f84a346dd7c223f?d=identicon&s=25 Yannick Majoros (Guest)
on 2006-06-09 15:52
(Received via mailing list)
Hello,

 I have following code in a helper:

 def custom_ajax(link, options)
    target = "target_" + options[:target_id]
    loading = "loading_" + options[:target_id]
    visible = "visible_" + options[:target_id]
    #options[:url] = {:inline => 1 }.merge(options[:url])
    test = {:inline => 1 }.merge(options[:url])
    link_to_remote(
      link,
      {
        :update => target,
        :loading => "loading('" + loading + "')",
        :loaded => "loaded('" + loading + "')",
        :before => "visible('" + visible + "')",
        :url => test
      }.merge(options)
    )
  end

 The problem is that ":inline" is not set if I do it this way. I found
some workaround, but I use this syntax in more places. What am I doing
wrong? Is there a better way than "merge"?

 Regards,

--
----------------------------------------------------------------------
Yannick Majoros http://www.inma.ucl.ac.be/~majoros
Informaticien UCL/INMA-MEMA
4, avenue G. Lemaître
B-1348 Louvain-la-Neuve
Tel: +32-10-47.80.10
Fax: +32-10-47.21.80
This topic is locked and can not be replied to.