Permalink
Browse files

Wrapping and parenthesis styles for ERB

  • Loading branch information...
1 parent 7b0f309 commit 67b4e1435403a0ca443708b6e259e53868b57c68 @jferris jferris committed Sep 5, 2012
Showing with 14 additions and 0 deletions.
  1. +8 −0 README.md
  2. +6 −0 erb-sample.erb
View
@@ -103,6 +103,14 @@ Ruby
* Use `each`, not `for`, for iteration.
* Use heredocs for multi-line strings.
+ERB
+---
+
+* When wrapping long lines, keep the method name on the same line as the ERB
+ interpolation operator and keep each method argument on its own line.
+
+[Sample](https://github.com/thoughtbot/style-guide/blob/master/erb-sample.erb)
+
Rails
-----
View
@@ -0,0 +1,6 @@
+<%= short_method_call_that_fits_on_one_line arguments %>
+
+<%= link_to(
+ some_object_with_a_long_name.title,
+ parent_object_child_object_path(some_object_with_a_long_name)
+) %>

0 comments on commit 67b4e14

Please sign in to comment.