AJAX: link_to_remote problem

I use:
<%= link_to_remote(“Update”,
:update => ‘mydiv’,
:url => { :action => :create, :host => ‘rails’ }) %>

which generates the following:


as a result /account/create is routed to http:/localhost//account/create
(which runs mod Python) and
not as I would like (and need) to http://rails/account/create

Using the following:

<%= link_to_remote(“Update 2”,
:update => ‘mydiv’,
:url => ‘http://rails/account/create’ ) %>

doesn’t work either. It results in using the correct url, but the url
parameter seems to be not correct:

TypeError in Account#create
can’t dup NilClass
RAILS_ROOT: C:/Projects/Athena/rails/public/…/config/…

Application Trace | Framework Trace | Full Trace

the controller contains:

def create
render :layout => false

create.rhtml contains:

Hello from Ajax!

new.rhtml contains:
<%= javascript_include_tag :defaults %>

<%= link_to_remote(“Update”,
:update => ‘mydiv’,
:url => { :action => :create, :host => ‘rails’ }) %>

This text will be changed 2

Does anybody have any idea on how to work around this problem?



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs