# class NeuigkeitenController

### Public Instance Methods

create() click to toggle source

    # File controllers/neuigkeiten_controller.rb, line 26
    def create
      @neuigkeit = Neuigkeit.new(params[:neuigkeit])

      respond_to do |format|
        if @neuigkeit.save
          format.html { redirect_to @neuigkeit, notice: 'Neuigkeit was successfully created.' }

        else
          format.html { render action: "new" }

        end
      end
    end

destroy() click to toggle source

DELETE /neuigkeiten/1 DELETE /neuigkeiten/1.json

    # File controllers/neuigkeiten_controller.rb, line 57
    def destroy
      @neuigkeit = Neuigkeit.find(params[:id])
      @neuigkeit.destroy

      respond_to do |format|
        format.html { redirect_to neuigkeiten_url }

      end
    end

edit() click to toggle source

    # File controllers/neuigkeiten_controller.rb, line 22
    def edit
      @neuigkeit = Neuigkeit.find(params[:id])
    end

index() click to toggle source

    # File controllers/neuigkeiten_controller.rb, line 3
    def index
      @neuigkeiten = Neuigkeit.all
    end

new() click to toggle source

    # File controllers/neuigkeiten_controller.rb, line 15
     def new
       @neuigkeit = Neuigkeit.new
       @rubrik=Rubrik.find(params[:rubrik_id])
       @neuigkeit.rubrik=@rubrik
    end

show() click to toggle source

    # File controllers/neuigkeiten_controller.rb, line 8
    def show
      @neuigkeit = Neuigkeit.find(params[:id])
      if can? :edit, @neuigkeit
          @toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_neuigkeit_path(@neuigkeit),:icon=>:pencil}
      end
    end

update() click to toggle source

    # File controllers/neuigkeiten_controller.rb, line 41
    def update
      @neuigkeit = Neuigkeit.find(params[:id])

      respond_to do |format|
        if @neuigkeit.update_attributes(params[:neuigkeit])
          format.html { redirect_to @neuigkeit, notice: 'Neuigkeit was successfully updated.' }

        else
          format.html { render action: "edit" }

        end
      end
    end