1.files in dir db/migrate/ can be seen as log files
2.> rake db:migrate ##to really write something into databases
3.def show
render plain: params[:id].inspect
end
test whether action works, by display numbers of id
4.创建和提交表单
<%= form_for @issue do |f| %>
<%= f.label :title %>
<%= f.text_field :title %>
<%= f.label :content %>
<%= f.text_area :content %>
<%= f.submit %>
<% end %>
5.When you want create new action ,in your pages, firstly create new path an its corresponding action in route.rb, then define new function which stand for an action in controller file(have to do this).
6.model 用来建立各个变量controller之间的关系。如has many和 belongs_to 等等。可利用:id 这个字段来建立。之后,要在含者里写入被含者的变量表示。
7.attribute errors 表明该模板没有该字段,需要
rails g migration Add(该字段)To(该模板) 该字段:interger or string or content
rake db:migrate
1.files in dir db/migrate/ can be seen as log files 2.> rake db:migrate ##to really write something into databases 3.def show render plain: params[:id].inspect end
test whether action works, by display numbers of id
4.创建和提交表单 <%= form_for @issue do |f| %> <%= f.label :title %> <%= f.text_field :title %> <%= f.label :content %> <%= f.text_area :content %> <%= f.submit %> <% end %> 5.When you want create new action ,in your pages, firstly create new path an its corresponding action in route.rb, then define new function which stand for an action in controller file(have to do this). 6.model 用来建立各个变量controller之间的关系。如has many和 belongs_to 等等。可利用:id 这个字段来建立。之后,要在含者里写入被含者的变量表示。 7.attribute errors 表明该模板没有该字段,需要