0
我想用Rails创建一个简单的应用微柱...HTemplate在轨缺少3.2
这是我的模型:
Class Micropost < ActiveRecord::Base
attr_accessible :content, :name
end
控制器:
class MicropostsController < ApplicationController
def create
@blog=Micropost.new(:content => params[:content])
@blog.save
redirect_to microposts_show_path
end
def show
@mblg=Micropost
end
def index
end
end
浏览次数:
create.html.erb
<h1>Microblogs#create</h1>
<p></p>
<%= label_tag(:content) %><br/>
<%= text_field_tag (:content) %><br/>
<%= submit_tag("submit") %><br/>
index.html.erb
<h1>Microblogs#index</h1>
<p>Find me in app/views/microblogs/index.html.erb</p>
show.html.erb
<h1>Microblogs#show</h1>
<p></p>
<%= @mblg.each.do |variable|%>
<p><%= variable.content %></p>
<%end%>
Routes.rb
Blog::Application.routes.draw do
get "microposts/create"
get "microposts/show"
get "microposts/index"
end
我得到一个模板失踪错误...这是一个相当简单的应用程序...你能指出我要去哪里错了吗?