class ItemsController < ApplicationController
  def index
    @items = Item.all
    render 'homepage_admin/index'
  end

  def show
    @item = Item.find(params[:id])
    render 'items/item'
  end

  def new
    @item = Item.new
    render 'items/_new'
  end

  def create
    # p params["item"]
    # p "*" * 100
    @item = Item.new(item_params)
    if @item.save
      flash[:notice] = "Item created."
      render '/homepage_admin/index'
    else
      render 'items/_new'
    end
  end

  def edit
    @item = Item.find(params[:id])
    render 'items/_edit'
  end

  def update
    @item = Item.find(params[:id])
    if @item.update(item_params)
      flash[:notice] = "Item updated."
      redirect_to '/homepage_admin/index'
    else
      render '/items/_form'
    end
  end

  def destroy
    @item = Item.find(params[:id])
    @item.destroy
    redirect_to items_path
  end

  private
    def item_params
      params.require(:item).permit(:name, :description, :price)
    end

end

class ItemsController < ApplicationController
  def index
    @items = Item.all
    render 'homepage_admin/index'
  end

  def show
    @item = Item.find(params[:id])
    render 'items/item'
  end

  def new
    @item = Item.new
    render 'items/_new'
  end

  def create
    # p params["item"]
    # p "*" * 100
    @item = Item.new(item_params)
    if @item.save
      flash[:notice] = "Item created."
      render '/homepage_admin/index'
    else
      render 'items/_new'
    end
  end

  def edit
    @item = Item.find(params[:id])
    render 'items/_edit'
  end

  def update
    @item = Item.find(params[:id])
    if @item.update(item_params)
      flash[:notice] = "Item updated."
      redirect_to '/homepage_admin/index'
    else
      render '/items/_edit'
    end
  end

  def destroy
    @item = Item.find(params[:id])
    @item.destroy
    redirect_to items_path
  end

  private
    def item_params
      params.require(:item).permit(:name, :description, :price)
    end

end

Correct path for edit form
Correct path for edit form
