Class/Module Index [+]

Quicksearch

FragenController

Public Instance Methods

create() click to toggle source

POST /fragen POST /fragen.json

# File app/controllers/fragen_controller.rb, line 49
def create
  @frage = Frage.new(params[:frage])
  thema=@frage.thema
  @fragen=@frage.thema.fragen
  respond_to do |format|
    if @frage.save
      format.html { redirect_to @frage.thema, notice: 'Frage was successfully created.' }
      format.json { render json: @frage, status: :created, location: @frage }
      format.js {@frage=Frage.new ; @frage.thema=thema}
    else
      format.html { render action: "new" }
      format.json { render json: @frage.errors, status: :unprocessable_entity }
      format.js 
    end
  end
end
destroy() click to toggle source

DELETE /fragen/1 DELETE /fragen/1.json

# File app/controllers/fragen_controller.rb, line 86
def destroy
  @frage = Frage.find(params[:id])
  @thema=@frage.thema
  @frage.destroy

  respond_to do |format|
    format.html { redirect_to @frage.thema }
    format.json { head :no_content }
    format.js { 
      @fragen=@thema.fragen
      render :create
    }
  end
end
edit() click to toggle source

GET /fragen/1/edit

# File app/controllers/fragen_controller.rb, line 39
def edit
  @frage = Frage.find(params[:id])
  respond_to do |format|
    format.html
    format.js {render action: :new}
  end 
end
index() click to toggle source
# File app/controllers/fragen_controller.rb, line 6
def index
  @fragen = Frage.all

  respond_to do |format|
    format.html # index.html.erb
    format.json { render json: @fragen }
  end
end
new() click to toggle source

GET /fragen/new GET /fragen/new.json

# File app/controllers/fragen_controller.rb, line 28
def new
  @frage = Frage.new

  respond_to do |format|
    format.html
    format.json { render json: @frage }
    format.js
  end
end
show() click to toggle source

GET /fragen/1 GET /fragen/1.json

# File app/controllers/fragen_controller.rb, line 17
def show
  @frage = Frage.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @frage }
  end
end
update() click to toggle source

PUT /fragen/1 PUT /fragen/1.json

# File app/controllers/fragen_controller.rb, line 68
def update
  @frage = Frage.find(params[:id])

  respond_to do |format|
    if @frage.update_attributes(params[:frage])
      format.html { redirect_to @frage, notice: 'Frage was successfully updated.' }
      format.json { head :no_content }
      format.js {@frage=Frage.new; render action: "new"}
    else
      format.html { render action: "edit" }
      format.json { render json: @frage.errors, status: :unprocessable_entity }
      format.js {render action: "edit"}
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.