为什么index.html.erb页面上没有“添加作业”链接?

时间:2016-09-14 20:00:42

标签: ruby-on-rails rubygems erb missing-features

我一直在关注教程,最后到目前为止:https://github.com/ScarletMcLearn/jobsboard

但是“添加作业”链接应该出现在index.html页面上,如index.html.erb文件所示:

<h1>Jobs</h1>
<% @jobs.each do |job| %>
  <div class="job">
    <h2><%= link_to job.title, job.url %></h2>
    <p><%= job.company %></p>
  </div>
<% end %>
<p><%= link_to "Add a job", new_job_path %></p>

但它不会来。 我是Rails的新手,所以简单的指示将不胜感激。 :d 如果有帮助,请查看回购:https://github.com/ScarletMcLearn/jobsboard

感谢您的阅读。 :d

rake路线输出:

  

前缀动词URI模式控制器#动作       jobs GET /jobs(.:format)jobs #index            POST /jobs(.:format)jobs #create new_job GET /jobs/new(.:format)jobs#new edit_job GET
  /jobs/:id/edit(.:format)jobs#edit        job GET /jobs/:id(.:format)jobs#show            PATCH /jobs/:id(.:format)jobs#update            PUT /jobs/:id(.:format)jobs#update            DELETE /jobs/:id(.:format)jobs #troy       root GET / jobs#index

0 个答案:

没有答案