Sha256: 0a318eaca23c2073a7c080c159bd0dc48d0a113cee5d1a21d90c6147ab4cd91d

Contents?: true

Size: 1.47 KB

Versions: 62

Compression:

Stored size: 1.47 KB

Contents

require_dependency "phcpress/application_controller"

module Phcpress
  class Modules::ConnectionsController < ApplicationController

    # Security and Filters
    before_action :set_modules_connection, only: [:show, :edit, :update, :destroy]

    # Connections Index
    def index
      @modules_connections = Modules::Connection.all
    end

    # Connections Show
    def show
    end

    # Connections New
    def new
      @modules_connection = Modules::Connection.new
    end

    # Connections Edit
    def edit
    end

    # POST
    def create
      @modules_connection = Modules::Connection.new(modules_connection_params)
      if @modules_connection.save
        redirect_to modules_connections_url, notice: 'Connection was successfully created.'
        else
          render :new
      end
    end

    # PATCH/PUT
    def update
      if @modules_connection.update(modules_connection_params)
        redirect_to modules_connections_url, notice: 'Connection was successfully updated.'
        else
          årender :edit
      end
    end

    # DELETE
    def destroy
      @modules_connection.destroy
      redirect_to modules_connections_url, notice: 'Connection was successfully destroyed.'
    end

    private

    # Common Callbacks
    def set_modules_connection
      @modules_connection = Modules::Connection.find(params[:id])
    end

    # Whitelist
    def modules_connection_params
      params.require(:modules_connection).permit(:post_id, :category_id)
    end

  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
phcpress-19.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-18.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-17.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-16.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-15.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-14.1.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-13.0.1 app/controllers/phcpress/modules/connections_controller.rb
phcpress-13.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-12.3.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-12.2.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-12.1.1 app/controllers/phcpress/modules/connections_controller.rb
phcpress-12.1.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-12.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-11.2.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-11.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-10.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-9.1.2 app/controllers/phcpress/modules/connections_controller.rb
phcpress-9.1.1 app/controllers/phcpress/modules/connections_controller.rb
phcpress-9.1.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-9.0.0 app/controllers/phcpress/modules/connections_controller.rb