Basic ideas:
- On server side:
-
- In routes.rb, setup routings to handle ajax request calls.
- In controller, handle ajax request by something like: respond_to do |format| format.js end
- In views, create *.js.erb file which has the same name as the corresponding controller function.
- On client side:
- In view pages, use tags like <%= button_to , ..., :remote => true, ... %>
- Trigger the ajax request. E.g. by $('#ajax_submit').submit();
- Create a javascript like fn_some_callback() to handle callback from ajax response.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.