How to invoke form_remote_tag from javascript?

Hello,

how can I move below functionality defined in rhtml to the javascript
function?

<% form_remote_tag :url => { :action => :small_courses_list } do %>
<%= submit_tag “click!” %>
<% end %>

I just want to invoke :small_courses_list action from the javascript
function by AJAX.

Thanks
gringo

On May 15, 1:11 am, gringo [email protected] wrote:

Hello,

how can I move below functionality defined in rhtml to the javascript
function?

The easiest way might be to inspect what html/js this produces

<% form_remote_tag :url => { :action => :small_courses_list } do %>
<%= submit_tag “click!” %>
<% end %>

Give it a go and you’ll see it’s just an Ajax.Request using
Form.serialize to get the params.

Fred

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