Skip to content

Instantly share code, notes, and snippets.

@xoen
Created September 5, 2012 15:40
Show Gist options
  • Save xoen/3638656 to your computer and use it in GitHub Desktop.
Save xoen/3638656 to your computer and use it in GitHub Desktop.
The [1] array is translated in a footnote, using the HTML Entities for square brackets (91 and 93) prevents it. Is there a better solution? Is it OK to comment this way?
xoen@ormofy:~/projects/rails/docrails/guides$ git diff
diff --git a/guides/source/action_view_overview.textile b/guides/source/action_view_overview.textile
index 1fd98a5..2fe9464 100644
--- a/guides/source/action_view_overview.textile
+++ b/guides/source/action_view_overview.textile
@@ -1211,7 +1211,10 @@ Sample usage (selecting the associated Authors for an instance of Post, +@post+)
collection_check_boxes(:post, :author_ids, Author.all, :id, :name_with_initial)
</ruby>
-If <tt>@post.author_ids</tt> is [1], this would return:
+<!-- NOTE: Read the following line as "If @post.author_ids is [1], this ..." -->
+<!-- NOTE: &#91; is the "[" char -->
+<!-- NOTE: &#93; is the "]" char -->
+If <tt>@post.author_ids</tt> is <tt>&#91;1&#93;</tt>, this would return:
<html>
<input id="post_author_ids_1" name="post[author_ids][]" type="checkbox" value="1" checked="checked" />
@mayankbpatel
Copy link

Any text sandwiched between two @ markers is automatically placed inside HTML tags.

Line 14 of your original gist can be changed to:
post.author_ids is @[1]@, this would return:

@xoen
Copy link
Author

xoen commented Sep 5, 2012

I've found the solution: If <tt>@post.author_ids</tt> is <tt><notextile>[1]</notextile></tt>, this w... :) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment