diff --git a/README.md b/README.md index c298bca6..88c4099c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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`. @@ -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 diff --git a/test/jbuilder_dependency_tracker_test.rb b/test/jbuilder_dependency_tracker_test.rb index b03fe696..d89be37a 100644 --- a/test/jbuilder_dependency_tracker_test.rb +++ b/test/jbuilder_dependency_tracker_test.rb @@ -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' diff --git a/test/jbuilder_test.rb b/test/jbuilder_test.rb index d3b37fce..76569bb6 100644 --- a/test/jbuilder_test.rb +++ b/test/jbuilder_test.rb @@ -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| diff --git a/test/scaffold_api_controller_generator_test.rb b/test/scaffold_api_controller_generator_test.rb index 02ed7af4..2c8f8ef8 100644 --- a/test/scaffold_api_controller_generator_test.rb +++ b/test/scaffold_api_controller_generator_test.rb @@ -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| diff --git a/test/scaffold_controller_generator_test.rb b/test/scaffold_controller_generator_test.rb index 452ad842..f3783007 100644 --- a/test/scaffold_controller_generator_test.rb +++ b/test/scaffold_controller_generator_test.rb @@ -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|