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?',