Skip to content

JSON view block #74

Open
Open

Description

@vladfaust
  json @worlds.map do |world|
    Views::World.new(world)
  end

Is treated as builder variant and

json @worlds.map { |world| Views::World.new(world) }

Is not.

Activity

  1. added this to the next patch milestone on Mar 24, 2019
  2. self-assigned this
    on Mar 24, 2019
  3. added a commit that references this issue on Apr 9, 2019
    9e60b18
  4. vladfaust commented on May 13, 2019

    @vladfaust
    MemberAuthor

    Also doesn't work for

    json tips: @tips.map do |tip|
      View::Tip.new(tip)
    end
       7.     def render_to_application_json(io : IO)
    >  8.       ({tips: @tips.map}).to_json(io)
       9.     end
    
    'Array(Models::Tip)#map' is expected to be invoked with a block, but no block was given
    
  5. vladfaust commented on May 28, 2019

    @vladfaust
    MemberAuthor

    Should put more thought into it. Given:

    json content_type: "application/json-a" do
      builder do
        field "foo", @foo
        field "bar", @bar
      end
    end

    What if I just wanted to add builder block arg?

    json content_type: "application/json-a" do |builder|
      builder do
        field "foo", @foo
        field "bar", @bar
      end
    end
  6. removed this from the 0.7.2 milestone on May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions