GithubHelp home page GithubHelp logo

cookpad / garage Goto Github PK

View Code? Open in Web Editor NEW
512.0 21.0 45.0 655 KB

Rails extension for RESTful Hypermedia API

License: MIT License

Ruby 78.23% JavaScript 16.82% CSS 1.51% HTML 1.38% Haml 1.86% Shell 0.11% Dockerfile 0.09%

garage's Issues

Broken with Hashie >= 3.0.0

Hashie >= 3.0.0 Mash::respond_to? always returns true when given method name ending with "!", "?", "_", "=".
Ref: hashie/hashie@5ac8516#diff-167a475bc5a73269819928a9da362073R190

It breaks this garage's code:
https://github.com/cookpad/garage/blob/master/lib/garage/representer.rb#L159

Garage assumes instance of Hashie::Mash to be a instance including Garage::Representer.
As a result of it, it fails at here with a message "NoMethodError: undefined method `params' for Hashie::Mash:Class ".

I suggest specifying Hashie < 3.0.0 in gemspec.

How to add extra actions?

I want to add extra actions(except :index, :create, :show, :update, :destroy), when used garage in my project, something like "/v1/users/get_names".

How to do that?

doorkeeper dependency

I read @taiki45's this post and the post describes about doorkeeper dependency as following.

Doorkeeper は Rails アプリケーションに OAuth 2 provider の機能を持たせるための gem です。Garage は Doorkeeper を用いて認可機能を提供します。

クックパッドでは複数の Garage アプリケーションが存在しているので、>Doorkeeper を使用せずに、認証認可サーバーへ認証認可を委譲するモジュールを >Garage に追加しています。このような Doorkeeper 以外の認可実装や認可を行わない実装への対応は Garage 本体へ追加予定です。

Is there any roadmap or schedules about this?

[Question] Any way to avoid to create show action for create action?

I created this controller

class UsersController < ApplicationController
  include Garage::RestfulActions

  def require_resources
    @resources = User.all
  end

  def require_resource
    @resource = User.find(params[:id])
  end

  def create_resource
    @resources.create(user_params)
  end

  private

  def user_params
    params
      .require(:user)
      .permit(:first_name, :last_name, :first_name_kana, :last_name_kana,
              :email, :password, :password_confirmation, :birthday, :sex)
  end
end

and routing

resources :users, only: [:index, :show, :create]

it works well, but if I don't want to provide and remove show action from routing, error occured like No route matches {:action=>"show", :controller=>"users", :id=>4} when i call create action. because of this line

There is any way to remove show action but using create action?

Thanks.

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.