Sha256: 12008607f7ac215784515594a1b38c11e2928927d06a6fb648c3e0b0b9f3dcc8

Contents?: true

Size: 1.51 KB

Versions: 17

Compression:

Stored size: 1.51 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

17 entries across 17 versions & 1 rubygems

Version Path
phcpress-7.1.2 app/controllers/phcpress/modules/connections_controller.rb
phcpress-7.1.1 app/controllers/phcpress/modules/connections_controller.rb
phcpress-7.1.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-7.0.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.7.3 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.7.2 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.7.1 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.7.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.6.6 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.6.5 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.6.4 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.6.3 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.6.1 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.6.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.5.1 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.5.0 app/controllers/phcpress/modules/connections_controller.rb
phcpress-6.4.5 app/controllers/phcpress/modules/connections_controller.rb