From 43baad78f758fe16485202643721a07852b25376 Mon Sep 17 00:00:00 2001 From: "Karunakar (Ruby)" Date: Sun, 9 Oct 2011 12:46:25 +0530 Subject: improving the docs for ajax_on_rails --- railties/guides/source/ajax_on_rails.textile | 35 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/railties/guides/source/ajax_on_rails.textile b/railties/guides/source/ajax_on_rails.textile index b5d4fb10f8..9f5afc87de 100644 --- a/railties/guides/source/ajax_on_rails.textile +++ b/railties/guides/source/ajax_on_rails.textile @@ -44,23 +44,30 @@ jquery-rails is default in Gemfile. javascript_include_tag :defaults +h4. Examples + All the remote_ true option to the original non-remote method -==== Examples button_to "New", :action => "new", :form_class => "new-thing" -# => "
-#
-#
" + +will produce + +
+
+
button_to "Create", :action => "create", :remote => true, :form => { "data-type" => "json" } -# => "
-#
-#
" + +will produce + +
+
+
@@ -69,12 +76,14 @@ button_to "Delete Image", { :action => "delete", :id => @image.id }, :confirm => "Are you sure?", :method => :delete -# => "
-#
-# -# -#
-#
" +will produce + +
+
+ + +
+
button_to('Destroy', 'http://www.example.com', :confirm => 'Are you sure?', -- cgit v1.2.3