Forum: Ruby on Rails url_for, form_remote_tag when rendered from an ajax referenc

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.
Stephen (Guest)
on 2007-04-19 01:40
(Received via mailing list)
I've done this a hundred times in other places in my code but it seems
that
this has suddenly broken.  I can replicate it on my coworkers
computer...
I'm generating a form_remote_tag from within a partial as so:

<% form_remote_tag(:update => 'acct_balance',
                   :url => '/report/ajax_get_balance',
                   :html => {:name => 'update_balance', :id =>
'update_balance'}) do -%>
<input type="text" name="balance_date" id="balance_date" style="display:
none;">
<% end -%>

When rendering this non-ajax, it generates the URL for form_remote_tag
correctly...

When Rendering this through an Ajax call in which case render :partial
is
called from same action, , I'm receiving:

undefined method `rewrite' for #<String:0x366c7a0>
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:522:in
`url_for'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/url_helper.rb:27:in
`url_for'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/url_helper.rb:75:in
`link_to'


in url_for in base.rb, this is doing:

@url.rewrite


however in this case @url.rewrite is a string when it is nromally a
UrlRewrite object so @url.rewrite fails..


Anyone have this problem? Running

lemming:/Users/sblackstone/development/rwjf root# rails -v
Rails 1.2.3


Thanks!

Stephen
This topic is locked and can not be replied to.