From f47026e7f92bcc55390636be1f196daa1c83452b Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 28 Oct 2012 12:15:35 -0200 Subject: Add backticks around link_to example in javascript guide [ci skip] --- guides/source/form_helpers.md | 2 +- guides/source/working_with_javascript_in_rails.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/form_helpers.md b/guides/source/form_helpers.md index ec1f1d4df1..f5db76f217 100644 --- a/guides/source/form_helpers.md +++ b/guides/source/form_helpers.md @@ -900,7 +900,7 @@ end } ``` -The keys of the `:addresses_attributes` hash are unimportant, they need merely be different for each address. +The keys of the `:addresses_attributes` hash are unimportant, they need merely be different for each address. If the associated object is already saved, `fields_for` autogenerates a hidden input with the `id` of the saved record. You can disable this by passing `:include_id => false` to `fields_for`. You may wish to do this if the autogenerated input is placed in a location where an input tag is not valid HTML or when using an ORM where children do not have an id. diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md index 27941c9166..6ec92bbfbc 100644 --- a/guides/source/working_with_javascript_in_rails.md +++ b/guides/source/working_with_javascript_in_rails.md @@ -216,7 +216,9 @@ You can bind to the same Ajax events as `form_for`. Here's an example. Let's assume that we have a resource `/fib/:n` that calculates the `n`th Fibonacci number. We would generate some HTML like this: +``` <%= link_to "Calculate", "/fib/15", remote: true, data: { fib: 15 } %> +``` and write some CoffeeScript like this: -- cgit v1.2.3