我是一名學生,我工作的一個應用程序,但是我得到這個錯誤缺少模板錯誤
缺少模板的工作/指數,應用/指數與{:區域設置=> [:EN]:格式=> [:html],:variants => [],:handlers => [:erb,:builder,:raw,:ruby,:coffee,:jbuilder]}。搜查:*「
林不知道如何破譯這個,我開始這個時,我創建了一個展示頁面,有人可以提供一些建議
顯示頁面:
<H1>Jobs Assigned to <%= @boat.name %></H1>
<% @boat.name.each do |job| %>
<h3>Cargo Origin: <%= job.cargo_origin %></h3>
<h3>Destination: <%= job.destination %></h3>
<h3>Containers Needed: <%= job.containers_needed %></h3>
<h3>Cargo: <%= job.cargo %></h3>
<h3>Job Cost: <%= job.job_cost %></h3>
<% end %>
喬布斯控制器:
class JobsController < ApplicationController
def index
@jobs = Job.all
end
def show
@job = Job.find(params[:id])
redirect_to user_path
end
def new
@boat = Boat.find(params[:boat_id])
@job = Job.new
end
def create
@boat = Boat.find(params[:boat_id])
@job = @boat.jobs.build(job_params)
@job.save
redirect_to user_path (current_user)
end
def edit
end
def update
end
def destroy
end
private
def job_params
params.require(:job).permit(:cargo_origin,:destination,:containers_needed,:cargo,:job_cost).merge(user_id: current_user.id)
end
end
在這行你得到這個錯誤有關的意見? – Pavan
什麼時候出現?創建或更新後? –