Sha256: 5e71abe02536162903050d750bd7618bfb14a6206a97bfa6698e7c1d43b6525b

Contents?: true

Size: 307 Bytes

Versions: 7

Compression:

Stored size: 307 Bytes

Contents

class RecipesController < ApplicationController
  validates :create do
    string :name, required: true, except: %w[alice bob]
    integer :type, only: 1..3
  end

  def show
    render json: Recipe.find(params[:id])
  end

  def create
    respond_with Recipe.create(params.permit(:name, :type))
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
autodoc-0.8.0 spec/dummy/app/controllers/recipes_controller.rb
autodoc-0.7.7 spec/dummy/app/controllers/recipes_controller.rb
autodoc-0.7.6 spec/dummy/app/controllers/recipes_controller.rb
autodoc-0.7.5 spec/dummy/app/controllers/recipes_controller.rb
autodoc-0.7.4 spec/dummy/app/controllers/recipes_controller.rb
autodoc-0.7.3 spec/dummy/app/controllers/recipes_controller.rb
autodoc-0.7.2 spec/dummy/app/controllers/recipes_controller.rb