Giter Club home page Giter Club logo

Comments (3)

philipqnguyen avatar philipqnguyen commented on June 3, 2024 1

Hello @andrzejsliwa

@dlcarter is away due to the holidays, so I will try to help you, and he can chime in after. While Blueprinter is currently open source, we haven't released it with a 0.1.0 version yet. We don't have a blog post on it yet, but you should hear more about it once we make 0.1.0, which should not be long. You can still give it a try, assuming inside a rails app:

# Gemfile
gem 'blueprinter', github: 'procore/blueprinter', branch: 'master'
# app/blueprints/user_blueprint
class UserBlueprint < Blueprinter::Base
  identifier :uuid # or you can leave this out to default to :id
  field :email, name: :login

  view :normal do
    fields :first_name, :last_name
  end

  view :extended do
    include_view :normal
    field :address
  end
end
# app/users_controllers
class UsersController < ApplicationController
  def index
    render json: UserBlueprint.render(User.all, view: :normal)
  end

  def show
    user = User.find params[:id]
    render json: UserBlueprint.render(user, view: :extended)
  end
end

from blueprinter.

philipqnguyen avatar philipqnguyen commented on June 3, 2024 1

@andrzejsliwa the gem is released, currently 0.2.0. So a typical gem install blueprinter would work now. I'll close this for now, but if you have any other questions, feel free to re-open or start a new issue.

from blueprinter.

philipqnguyen avatar philipqnguyen commented on June 3, 2024

We also welcome any help with issues or PRs as well!

from blueprinter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.