Forum: Ruby on Rails Ajax not defined.

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.
Intern r. (Guest)
on 2009-03-23 14:52
Attachment: new.html.erb (0 Bytes)
This is my code and I am trying to call remote function when somebody
click on add button after selecting something from select_tag. Please
tell me where I am wrong ? I am getting following error: Ajax not
defined.

<input type="button" value="< Add" class="button" onclick="<%=
remote_function(:url => {:controller => 'users', :action => 'add_line'})
%>" />


<%= select_tag 'available_line_id[]',options_for_select(customers),{:id
=> 'available_line_id',:multiple => true, :size => 13, :style => 'width:
225px;'} %>



Thanks,
Frederick C. (Guest)
on 2009-03-23 15:14
(Received via mailing list)
On Mar 23, 12:52 pm, Intern ruby <removed_email_address@domain.invalid>
wrote:
> This is my code and I am trying to call remote function when somebody
> click on add button after selecting something from select_tag. Please
> tell me where I am wrong ? I am getting following error: Ajax not
> defined.

Probably means that your page doesn't load the prototype javascript
library (which is the thing that adds the Ajax object). See
javascript_include_tag

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