# class RubrikenController

### Public Instance Methods

addmoderator() click to toggle source

    # File controllers/rubriken_controller.rb, line 36
    def addmoderator
      @rubrik = Rubrik.find(params[:id])
      if can? :addmoderator, @rubrik
        if params[:moderator].nil?
          current_user.add_role(:newsmoderator,@rubrik)
        else
          User.find(params[:moderator]).add_role(:newsmoderator, @rubrik)
        end

        response_notice= I18n.t("rubrik/moderatoradded")
      else
        response_notice= I18n.t("rubrik/moderatoraddnorights")
      end
      respond_to do |format|
        format.html { redirect_to @rubrik,:notice => response_notice }
      end
    end

alle_verwalten() click to toggle source

    # File controllers/rubriken_controller.rb, line 70
    def alle_verwalten
    @rubriken =Rubrik.all
    end

create() click to toggle source

    # File controllers/rubriken_controller.rb, line 24
    def create
      @rubrik = Rubrik.new(params[:rubrik])

      respond_to do |format|
        if @rubrik.save
          format.html { redirect_to @rubrik, notice: 'Rubrik was successfully created.' }
        else
          format.html { render action: "new" }
        end
      end
    end

destroy() click to toggle source

DELETE /rubriken/1 DELETE /rubriken/1.json

    # File controllers/rubriken_controller.rb, line 75
    def destroy
      @rubrik = Rubrik.find(params[:id])
      @rubrik.destroy
      redirect_to rubriken_url
    end

edit() click to toggle source

    # File controllers/rubriken_controller.rb, line 19
    def edit
      @rubrik = Rubrik.find(params[:id])
    end

index() click to toggle source

    # File controllers/rubriken_controller.rb, line 3
    def index
      @rubriken = Rubrik.all

    end

new() click to toggle source

    # File controllers/rubriken_controller.rb, line 14
    def new
      @rubrik = Rubrik.new

    end

show() click to toggle source

    # File controllers/rubriken_controller.rb, line 9
    def show
      @rubrik = Rubrik.find(params[:id])
      @moderatoren=User.with_role(:newsmoderator,@rubrik)
    end

update() click to toggle source

    # File controllers/rubriken_controller.rb, line 53
    def update
      @rubrik = Rubrik.find(params[:id])

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

verwalten() click to toggle source

    # File controllers/rubriken_controller.rb, line 66
    def verwalten
    @rubrik = Rubrik.find(params[:id])
    @moderatoren=User.with_role(:newsmoderator,@rubrik)
    end