【发布时间】:2015-01-19 17:04:43
【问题描述】:
点击网址http://localhost:3000/articles/new/时发生错误。
显示第 8 行出现的 c:/Sites/blog/app/views/articles/new.html.erb:
无法从 C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/locale/en.yml 加载翻译:期望它返回一个哈希,但没有
文件 blog.html.erp
<h1>New article</h1>
<%= form_for :article do |f| %>
<p>
<%= f.label :title%><br>
<%= f.text_field :title %>
</p>
<p>
<%= f.label :text%><br>
<%= f.text_area :text %>
</p>
<p>
<%= f.submit %>
</p>
<% end %>
控制器文章动作新。
class ArticlesController < ApplicationController
def new
end
end
文件配置/routes.rb
Rails.application.routes.draw do
resource :articles
get 'welcome/index'
导轨 4.1.8 红宝石 2.1.5 窗口 7
【问题讨论】:
标签: ruby ruby-on-rails-4