Sha256: 0463b8fad4834787ce1c1ce1a137812ddf23ef968cfb33e786b145d2da66b1e4

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

module LesliAudit
  class DashboardsController < ApplicationController
    #before_action :set_dashboard, only: %i[ show edit update destroy ]

    # GET /dashboards
    def index
    end

    # GET /dashboards/1
    def show
    end

    # GET /dashboards/new
    def new
      @dashboard = Dashboard.new
    end

    # GET /dashboards/1/edit
    def edit
    end

    # POST /dashboards
    def create
      @dashboard = Dashboard.new(dashboard_params)

      if @dashboard.save
        redirect_to @dashboard, notice: "Dashboard was successfully created."
      else
        render :new, status: :unprocessable_entity
      end
    end

    # PATCH/PUT /dashboards/1
    def update
      if @dashboard.update(dashboard_params)
        redirect_to @dashboard, notice: "Dashboard was successfully updated.", status: :see_other
      else
        render :edit, status: :unprocessable_entity
      end
    end

    # DELETE /dashboards/1
    def destroy
      @dashboard.destroy
      redirect_to dashboards_url, notice: "Dashboard was successfully destroyed.", status: :see_other
    end

    private
      # Use callbacks to share common setup or constraints between actions.
      def set_dashboard
        @dashboard = Dashboard.find(params[:id])
      end

      # Only allow a list of trusted parameters through.
      def dashboard_params
        params.fetch(:dashboard, {})
      end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lesli_audit-0.4.0 app/controllers/lesli_audit/dashboards_controller.rb
lesli_audit-0.3.0 app/controllers/lesli_audit/dashboards_controller.rb
lesli_audit-0.2.0 app/controllers/lesli_audit/dashboards_controller.rb
lesli_audit-0.1.0 app/controllers/lesli_audit/dashboards_controller.rb