Git Product home page Git Product logo

wadlgen's People

Contributors

austvik avatar danknox avatar zorbash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wadlgen's Issues

Retrieve responses and requests content types

I would like to create a documentation file for RESTful Ruby on Rails application. This project helped me to retrieve the HTTP paths, verbs and also the parameters.
For getting the content type of responses and request, I tried with it and couldn't get any entry.

*I using Rails 4.1
My controller is as the following:

class AutosController < ApplicationController
  before_action :set_auto, only: [:show, :edit, :update, :destroy]
  # GET /autos
  # GET /autos.json
  def index
    @autos = Auto.all
  end

  # GET /autos/1
  # GET /autos/1.json
  def show
  end

  # GET /autos/new
  def new
    @auto = Auto.new
  end

  # GET /autos/1/edit
  def edit
  end

  # POST /autos
  # POST /autos.json
  def create
    @auto = Auto.new(auto_params)

    respond_to do |format|
      if @auto.save
        format.html { redirect_to @auto, notice: 'Auto was successfully created.' }
        format.json { render :show, status: :created, location: @auto }
      else
        format.html { render :new }
        format.json { render json: @auto.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /autos/1
  # PATCH/PUT /autos/1.json
  def update
    respond_to do |format|
      if @auto.update(auto_params)
        format.html { redirect_to @auto, notice: 'Auto was successfully updated.' }
        format.json { render :show, status: :ok, location: @auto }
      else
        format.html { render :edit }
        format.json { render json: @auto.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /autos/1
  # DELETE /autos/1.json
  def destroy
    @auto.destroy
    respond_to do |format|
      format.html { redirect_to autos_url, notice: 'Auto was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

 def buy
    @auto = Auto.find(params[:id])
    respond_to do |format|
      if @auto.update_attribute(:gekauft, true)
        format.html { redirect_to @auto, notice: 'Auto wurde erfolgreich gekauft.'}
        format.json { head :no_content }
      else
        format.html { redirect_to @auto, notice: 'Fehler beim Kauf.'}
        format.json { render json: @auto.errors, status: :unprocessable_entity }
      end
    end
  end


  def sell
    @auto = Auto.find(params[:id])
    respond_to do |format|
      if @auto.update_attribute(:gekauft, false)
        format.html { redirect_to @auto, notice: 'Auto wurde erfolgreich verkauft.'}
        format.json { head :no_content }
      else
        format.html { redirect_to @auto, notice: 'Fehler beim Verkauf.'}
        format.json { render json: @auto.errors, status: :unprocessable_entity }
      end
    end
  end



  private

  # Use callbacks to share common setup or constraints between actions.
  def set_auto
    @auto = Auto.find(params[:id])
  end

  # Never trust parameters from the scary internet, only allow the white list through.
  def auto_params
    params.require(:auto).permit(:farbe, :anzahl_sitze, :gekauft)
  end


 end

rails 31 error?

Hey, I was trying this gem out. Is the error 31 specific? Thanks. :)

bundle exec rake wadlgen
rake aborted!
wrong constant name _controller

Tasks: TOP => wadlgen
(See full trace by running task with --trace)

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.