Skip to content

Commit

Permalink
Clarify ambiguous language
Browse files Browse the repository at this point in the history
  • Loading branch information
snan committed Apr 12, 2024
1 parent ea15197 commit 4ebad65
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions REFERENCE.md
Expand Up @@ -568,7 +568,7 @@ prefix for both the id and class attributes. For example:
# file: app/controllers/users_controller.rb

def show
@user = CrazyUser.find(15)
@user = FriendlyUser.find(15)
end

-# file: app/views/users/show.haml
Expand All @@ -579,19 +579,19 @@ prefix for both the id and class attributes. For example:

is compiled to:

<div class='greeting_crazy_user' id='greeting_crazy_user_15'>
<div class='greeting_friendly_user' id='greeting_friendly_user_15'>
<bar class='fixnum' id='fixnum_581' />
Hello!
</div>

If you require that the class be something other than the underscored object's
class, you can implement the `haml_object_ref` method on the object.

# file: app/models/crazy_user.rb
# file: app/models/friendly_user.rb

class CrazyUser < ActiveRecord::Base
class FriendlyUser < ActiveRecord::Base
def haml_object_ref
"a_crazy_user"
"a_friendly_user"
end
end

Expand All @@ -602,7 +602,7 @@ class, you can implement the `haml_object_ref` method on the object.

is compiled to:

<div class='a_crazy_user' id='a_crazy_user_15'>
<div class='a_friendly_user' id='a_friendly_user_15'>
Hello!
</div>

Expand Down
2 changes: 1 addition & 1 deletion test/haml/engine_test.rb
Expand Up @@ -455,7 +455,7 @@ def test_nil_option
assert_equal("<p foo='bar'></p>\n", render('%p{:foo => "bar"}', :attr_wrapper => nil))
end

def test_comment_with_crazy_nesting
def test_comment_with_wild_nesting
assert_equal(<<HTML, render(<<HAML))
foo
bar
Expand Down
2 changes: 1 addition & 1 deletion test/haml/erb/_av_partial_2.erb
@@ -1,6 +1,6 @@
<% @nesting -= 1 %>
<div class="partial" level="<%= @nesting %>">
<h3>This is a crazy deep-nested partial.</h3>
<h3>This is a tangled deep-nested partial.</h3>
<p>Nesting level <%= @nesting %></p>
<% if @nesting > 0 %>
<%= render :partial => 'erb/av_partial_2' %>
Expand Down
2 changes: 1 addition & 1 deletion test/haml/erb/action_view.erb
Expand Up @@ -10,7 +10,7 @@
except that it has some ActionView-specific stuff.
It's only used for benchmarking.
</h1>
<div class="crazy_partials">
<div class="intense_partials">
<%= render :partial => 'erb/av_partial_1' %>
</div>
<!-- You're In my house now! -->
Expand Down
6 changes: 3 additions & 3 deletions test/haml/results/helpers.xhtml
Expand Up @@ -2,7 +2,7 @@
<div>
<p class='title'>Title</p>
<p class='text'>
Woah this is really crazy
Woah this is really wild
I mean wow,
man.
</p>
Expand All @@ -11,7 +11,7 @@ man.
<div>
<p class='title'>Title</p>
<p class='text'>
Woah this is really crazy
Woah this is really wild
I mean wow,
man.
</p>
Expand All @@ -20,7 +20,7 @@ man.
<div>
<p class='title'>Title</p>
<p class='text'>
Woah this is really crazy
Woah this is really wild
I mean wow,
man.
</p>
Expand Down
2 changes: 1 addition & 1 deletion test/haml/templates/_av_partial_2.haml
@@ -1,5 +1,5 @@
- @nesting -= 1
.partial{:level => @nesting}
%h3 This is a crazy deep-nested partial.
%h3 This is a wild deep-nested partial.
%p== Nesting level #{@nesting}
= render :partial => 'templates/av_partial_2' if @nesting > 0
2 changes: 1 addition & 1 deletion test/haml/templates/_av_partial_2_ugly.haml
@@ -1,5 +1,5 @@
- @nesting -= 1
.partial{:level => @nesting}
%h3 This is a crazy deep-nested partial.
%h3 This is a wild deep-nested partial.
%p== Nesting level #{@nesting}
= render :partial => 'templates/av_partial_2_ugly' if @nesting > 0
2 changes: 1 addition & 1 deletion test/haml/templates/action_view.haml
Expand Up @@ -8,7 +8,7 @@
This is very much like the standard template,
except that it has some ActionView-specific stuff.
It's only used for benchmarking.
.crazy_partials= render :partial => 'templates/av_partial_1'
.intense_partials= render :partial => 'templates/av_partial_1'
/ You're In my house now!
.header
Yes, ladies and gentileman. He is just that egotistical.
Expand Down
2 changes: 1 addition & 1 deletion test/haml/templates/action_view_ugly.haml
Expand Up @@ -8,7 +8,7 @@
This is very much like the standard template,
except that it has some ActionView-specific stuff.
It's only used for benchmarking.
.crazy_partials= render :partial => 'templates/av_partial_1_ugly'
.intense_partials= render :partial => 'templates/av_partial_1_ugly'
/ You're In my house now!
.header
Yes, ladies and gentileman. He is just that egotistical.
Expand Down
2 changes: 1 addition & 1 deletion test/haml/templates/helpers.haml
Expand Up @@ -3,7 +3,7 @@
%div
%p.title Title
%p.text
Woah this is really crazy
Woah this is really wild
I mean wow,
man.
- 3.times do
Expand Down

0 comments on commit 4ebad65

Please sign in to comment.