<file_sep>class CreateJobApps < ActiveRecord::Migration[5.2]
  def change
    create_table :job_apps do |t|
      t.string :First
      t.string :Name
      t.string :Last
      t.string :Name
      t.numeric :Phone
      t.string :Job
      t.text :Role
      t.text :Place

      t.timestamps
    end
  end
end
<file_sep>json.extract! job_app, :id, :First, :Name, :Last, :Name, :Phone, :Job, :Role, :Place, :created_at, :updated_at
json.url job_app_url(job_app, format: :json)
<file_sep>module PacecomTechnologiesHelper
   
  
  def show_errors(object,first_Name)
     if object.errors.any?  
      if  !object.errors.messages[first_Name].blank?
        object.errors.add(:first_Name, '*cannot be blank, *should be unique').join(',')
      end
    end
  end
      
      def show_errorsa(object,last_Name)
        if object.errors.any?
          if !object.errors.messages[last_Name].blank?
            #object.errors.messages[last_Name].join(", ")
           object.errors.add(:last_Name, '*cannot be blank.').join('')
          end
        end
      end  


      def show_errorsb(object,phone)
        if object.errors.any?
          if !object.errors.messages[phone].blank?
            #object.errors.messages[phone].join(", ")
            object.errors.add(:phone, '*cannot be blank,  *only numbers').join(',')
          end
        end
      end

      def show_errorsc(object,job_Role)
        if object.errors.any?
          if !object.errors.messages[job_Role].blank?
           # object.errors.messages[job_Role].join(", ")
           object.errors.add(:job_Role, '*cannot be blank.').join('')
          end
        end
        end

        def show_errorsd(object,place)
          if object.errors.any?
            if !object.errors.messages[place].blank?
              #object.errors.messages[place].join(", ")
              object.errors.add(:place, '*cannot be blank.').join('')
            end
          end
        end
      end        
<file_sep>require "application_system_test_case"

class PacecomTechnologiesTest < ApplicationSystemTestCase
  setup do
    @pacecom_technology = pacecom_technologies(:one)
  end

  test "visiting the index" do
    visit pacecom_technologies_url
    assert_selector "h1", text: "Pacecom Technologies"
  end

  test "creating a Pacecom technology" do
    visit pacecom_technologies_url
    click_on "New Pacecom Technology"

    fill_in "First name", with: @pacecom_technology.First_Name
    fill_in "Job role", with: @pacecom_technology.Job_Role
    fill_in "Last name", with: @pacecom_technology.Last_Name
    fill_in "Phone", with: @pacecom_technology.Phone
    fill_in "Place", with: @pacecom_technology.Place
    click_on "Create Pacecom technology"

    assert_text "Pacecom technology was successfully created"
    click_on "Back"
  end

  test "updating a Pacecom technology" do
    visit pacecom_technologies_url
    click_on "Edit", match: :first

    fill_in "First name", with: @pacecom_technology.First_Name
    fill_in "Job role", with: @pacecom_technology.Job_Role
    fill_in "Last name", with: @pacecom_technology.Last_Name
    fill_in "Phone", with: @pacecom_technology.Phone
    fill_in "Place", with: @pacecom_technology.Place
    click_on "Update Pacecom technology"

    assert_text "Pacecom technology was successfully updated"
    click_on "Back"
  end

  test "destroying a Pacecom technology" do
    visit pacecom_technologies_url
    page.accept_confirm do
      click_on "Destroy", match: :first
    end

    assert_text "Pacecom technology was successfully destroyed"
  end
end
<file_sep>json.extract! pacecom_technology, :id, :First_Name, :Last_Name, :Phone, :Job_Role, :Place, :created_at, :updated_at
json.url pacecom_technology_url(pacecom_technology, format: :json)
<file_sep>class CreatePacecomTechnologies < ActiveRecord::Migration[5.2]
  def change
    create_table :pacecom_technologies do |t|
      t.string :First_Name
      t.string :Last_Name
      t.integer :Phone
      t.text :Job_Role
      t.text :Place

      t.timestamps
    end
  end
end
<file_sep>class PacecomTechnologiesController < ApplicationController
  before_action :set_pacecom_technology, only: [:show, :edit, :update, :destroy]

  # GET /pacecom_technologies
  # GET /pacecom_technologies.json
  def index
    @pacecom_technologies = PacecomTechnology.all
  end

  # GET /pacecom_technologies/1
  # GET /pacecom_technologies/1.json
  def show
  end

  # GET /pacecom_technologies/new
  def new
    @pacecom_technology = PacecomTechnology.new
  end

  # GET /pacecom_technologies/1/edit
  def edit
  end

  # POST /pacecom_technologies
  # POST /pacecom_technologies.json
  def create
    @pacecom_technology = PacecomTechnology.new(pacecom_technology_params)

    respond_to do |format|
      if @pacecom_technology.save
        format.html { redirect_to @pacecom_technology, notice: 'New user was successfully created.' }
        format.json { render :show, status: :created, location: @pacecom_technology }
      else
        format.html { render :new }
        format.json { render json: @pacecom_technology.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /pacecom_technologies/1
  # PATCH/PUT /pacecom_technologies/1.json
  def update
    respond_to do |format|
      if @pacecom_technology.update(pacecom_technology_params)
        format.html { redirect_to @pacecom_technology, notice: 'User was successfully updated.' }
        format.json { render :show, status: :ok, location: @pacecom_technology }
      else
        format.html { render :edit }
        format.json { render json: @pacecom_technology.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /pacecom_technologies/1
  # DELETE /pacecom_technologies/1.json
  def destroy
    @pacecom_technology.destroy
    respond_to do |format|
      format.html { redirect_to pacecom_technologies_url, notice: 'User was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

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

    # Only allow a list of trusted parameters through.
    def pacecom_technology_params
      params.require(:pacecom_technology).permit(:First_Name, :Last_Name, :Phone, :Job_Role, :Place, :image)
    end
end
<file_sep>class JobApp < ApplicationRecord
end
<file_sep>class PacecomTechnology < ApplicationRecord
    has_one_attached :image

    validates :First_Name, :Last_Name, :Phone, :Job_Role, :Place, :presence => true
   validates :Phone, presence: true
    validate :correct_image_type
   # validates_uniqueness_of :First_Name, :message =>'should be unique'
   validates_uniqueness_of :First_Name, message:"should be unique"
   #validates_uniqueness_of :First_Name, scope: :Last_Name
   #add_index :pacecom_technologies, [ :First_Name, :Last_Name ], :unique => true, message 'noooo'
  
    
    private

    def correct_image_type
        if image.attached? && !image.content_type.in?(%w(image/jpeg image/png))
            errors.add(:image, 'must be jpeg or png.')
        elsif image.attached? == false
            errors.add(:image, 'Not attached')
        end
    end  
    
      
end
<file_sep>json.partial! "pacecom_technologies/pacecom_technology", pacecom_technology: @pacecom_technology
<file_sep>class JobAppsController < ApplicationController
  before_action :set_job_app, only: [:show, :edit, :update, :destroy]

  # GET /job_apps
  # GET /job_apps.json
  def index
    @job_apps = JobApp.all
  end

  # GET /job_apps/1
  # GET /job_apps/1.json
  def show
  end

  # GET /job_apps/new
  def new
    @job_app = JobApp.new
  end

  # GET /job_apps/1/edit
  def edit
  end

  # POST /job_apps
  # POST /job_apps.json
  def create
    @job_app = JobApp.new(job_app_params)

    respond_to do |format|
      if @job_app.save
        format.html { redirect_to @job_app, notice: 'Job app was successfully created.' }
        format.json { render :show, status: :created, location: @job_app }
      else
        format.html { render :new }
        format.json { render json: @job_app.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /job_apps/1
  # PATCH/PUT /job_apps/1.json
  def update
    respond_to do |format|
      if @job_app.update(job_app_params)
        format.html { redirect_to @job_app, notice: 'Job app was successfully updated.' }
        format.json { render :show, status: :ok, location: @job_app }
      else
        format.html { render :edit }
        format.json { render json: @job_app.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /job_apps/1
  # DELETE /job_apps/1.json
  def destroy
    @job_app.destroy
    respond_to do |format|
      format.html { redirect_to job_apps_url, notice: 'Job app was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

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

    # Only allow a list of trusted parameters through.
    def job_app_params
      params.require(:job_app).permit(:First, :Name, :Last, :Name, :Phone, :Job, :Role, :Place)
    end
end
<file_sep>require 'test_helper'

class PacecomTechnologiesControllerTest < ActionDispatch::IntegrationTest
  setup do
    @pacecom_technology = pacecom_technologies(:one)
  end

  test "should get index" do
    get pacecom_technologies_url
    assert_response :success
  end

  test "should get new" do
    get new_pacecom_technology_url
    assert_response :success
  end

  test "should create pacecom_technology" do
    assert_difference('PacecomTechnology.count') do
      post pacecom_technologies_url, params: { pacecom_technology: { First_Name: @pacecom_technology.First_Name, Job_Role: @pacecom_technology.Job_Role, Last_Name: @pacecom_technology.Last_Name, Phone: @pacecom_technology.Phone, Place: @pacecom_technology.Place } }
    end

    assert_redirected_to pacecom_technology_url(PacecomTechnology.last)
  end

  test "should show pacecom_technology" do
    get pacecom_technology_url(@pacecom_technology)
    assert_response :success
  end

  test "should get edit" do
    get edit_pacecom_technology_url(@pacecom_technology)
    assert_response :success
  end

  test "should update pacecom_technology" do
    patch pacecom_technology_url(@pacecom_technology), params: { pacecom_technology: { First_Name: @pacecom_technology.First_Name, Job_Role: @pacecom_technology.Job_Role, Last_Name: @pacecom_technology.Last_Name, Phone: @pacecom_technology.Phone, Place: @pacecom_technology.Place } }
    assert_redirected_to pacecom_technology_url(@pacecom_technology)
  end

  test "should destroy pacecom_technology" do
    assert_difference('PacecomTechnology.count', -1) do
      delete pacecom_technology_url(@pacecom_technology)
    end

    assert_redirected_to pacecom_technologies_url
  end
end
<file_sep>json.array! @job_apps, partial: "job_apps/job_app", as: :job_app
<file_sep>require "application_system_test_case"

class JobAppsTest < ApplicationSystemTestCase
  setup do
    @job_app = job_apps(:one)
  end

  test "visiting the index" do
    visit job_apps_url
    assert_selector "h1", text: "Job Apps"
  end

  test "creating a Job app" do
    visit job_apps_url
    click_on "New Job App"

    fill_in "First", with: @job_app.First
    fill_in "Job", with: @job_app.Job
    fill_in "Last", with: @job_app.Last
    fill_in "Name", with: @job_app.Name
    fill_in "Phone", with: @job_app.Phone
    fill_in "Place", with: @job_app.Place
    fill_in "Role", with: @job_app.Role
    click_on "Create Job app"

    assert_text "Job app was successfully created"
    click_on "Back"
  end

  test "updating a Job app" do
    visit job_apps_url
    click_on "Edit", match: :first

    fill_in "First", with: @job_app.First
    fill_in "Job", with: @job_app.Job
    fill_in "Last", with: @job_app.Last
    fill_in "Name", with: @job_app.Name
    fill_in "Phone", with: @job_app.Phone
    fill_in "Place", with: @job_app.Place
    fill_in "Role", with: @job_app.Role
    click_on "Update Job app"

    assert_text "Job app was successfully updated"
    click_on "Back"
  end

  test "destroying a Job app" do
    visit job_apps_url
    page.accept_confirm do
      click_on "Destroy", match: :first
    end

    assert_text "Job app was successfully destroyed"
  end
end
<file_sep>require 'test_helper'

class JobAppsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @job_app = job_apps(:one)
  end

  test "should get index" do
    get job_apps_url
    assert_response :success
  end

  test "should get new" do
    get new_job_app_url
    assert_response :success
  end

  test "should create job_app" do
    assert_difference('JobApp.count') do
      post job_apps_url, params: { job_app: { First: @job_app.First, Job: @job_app.Job, Last: @job_app.Last, Name: @job_app.Name, Phone: @job_app.Phone, Place: @job_app.Place, Role: @job_app.Role } }
    end

    assert_redirected_to job_app_url(JobApp.last)
  end

  test "should show job_app" do
    get job_app_url(@job_app)
    assert_response :success
  end

  test "should get edit" do
    get edit_job_app_url(@job_app)
    assert_response :success
  end

  test "should update job_app" do
    patch job_app_url(@job_app), params: { job_app: { First: @job_app.First, Job: @job_app.Job, Last: @job_app.Last, Name: @job_app.Name, Phone: @job_app.Phone, Place: @job_app.Place, Role: @job_app.Role } }
    assert_redirected_to job_app_url(@job_app)
  end

  test "should destroy job_app" do
    assert_difference('JobApp.count', -1) do
      delete job_app_url(@job_app)
    end

    assert_redirected_to job_apps_url
  end
end
<file_sep>json.partial! "job_apps/job_app", job_app: @job_app
