Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ company.to_builder.target!
```

You can either use Jbuilder stand-alone or directly as an ActionView template
language. When required in Rails, you can create views a la show.json.jbuilder
language. When required in Rails, you can create views à la show.json.jbuilder
(the json is already yielded):

``` ruby
Expand Down Expand Up @@ -207,7 +207,7 @@ json.comments @post.comments, partial: 'comments/comment', as: :comment
```

The `as: :some_symbol` is used with partials. It will take care of mapping the passed in object to a variable for the
partial. If the value is a collection (either implicitly or explicitly by using the `collection:` option, then each
partial. If the value is a collection either implicitly or explicitly by using the `collection:` option, then each
value of the collection is passed to the partial as the variable `some_symbol`. If the value is a singular object,
then the object is passed to the partial as the variable `some_symbol`.

Expand All @@ -219,7 +219,7 @@ Be sure not to confuse the `as:` option to mean nesting of the partial. For exam
json.partial! @comment, as: :comment
```

is quite different than:
is quite different from:

```ruby
# comment attributes are nested under a "comment" property
Expand Down
2 changes: 1 addition & 1 deletion test/jbuilder_dependency_tracker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def track_dependencies(source)
assert_equal %w[comments/comment], dependencies
end

test 'detects explicit depedency' do
test 'detects explicit dependency' do
dependencies = track_dependencies <<-RUBY
# Template Dependency: path/to/partial
json.foo 'bar'
Expand Down
2 changes: 1 addition & 1 deletion test/jbuilder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class JbuilderTest < ActiveSupport::TestCase
assert_equal 'world', result['comments'].second['content']
end

test 'nesting multiple chilren from a non-Enumerable that responds to #map with inline loop' do
test 'nesting multiple children from a non-Enumerable that responds to #map with inline loop' do
comments = NonEnumerable.new([ Comment.new('hello', 1), Comment.new('world', 2) ])

result = jbuild do |json|
Expand Down
2 changes: 1 addition & 1 deletion test/scaffold_api_controller_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ScaffoldApiControllerGeneratorTest < Rails::Generators::TestCase
end
end

test 'dont use require and permit if there are no attributes' do
test "don't use require and permit if there are no attributes" do
run_generator %w(Post --api)

assert_file 'app/controllers/posts_controller.rb' do |content|
Expand Down
2 changes: 1 addition & 1 deletion test/scaffold_controller_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
end
end

test 'dont use require and permit if there are no attributes' do
test "don't use require and permit if there are no attributes" do
run_generator %w(Post)

assert_file 'app/controllers/posts_controller.rb' do |content|
Expand Down