zoukankan      html  css  js  c++  java
  • Migrating to Rails 2.0.2

    Migrating to Rails 2.0.2

    Action View
    1)1.2
    new.rhtml
    ---------
    <%= form_tag :action => 'create' %>
      <%= render :partial => 'form' %>
      <%= submit_tag 'Create' %>
    <%= end_form_tag %>

    <%= link_to 'Back', :action => 'index' %>
    =========================================
    _form.rhtml
    -----------
    <%= error_messages_for 'author' %>
    <p><label for="author_first_name">First name</label><br/>

    <%= text_field 'author', 'first_name' %></p>
    <p><label for="author_last_name">Last name</label><br/>

    <%= text_field 'author', 'last_name' %></p>
    ============================================
    ********************************************
    1)2.0.2
    new.html.erb
    ------------
    (on redflag.heroku.com/books)
    <h1>New book</h1>
     
    <%= error_messages_for :book %>
     
    <% form_for(@book) do |f| %>
      <p>
        <b>Name</b><br />
        <%= f.text_field :name %>
      </p>
     
      <p>
        <b>Publisher</b><br />
        <%= f.text_field :publisher %>
      </p>
     
      <p>
        <b>Url</b><br />
        <%= f.text_field :url %>
      </p>
     
      <p>
        <%= f.submit "Create" %>
      </p>
    <% end %>
     
    <%= link_to 'Back', books_path %>
     


  • 相关阅读:
    MySQL Binlog解析(2)
    在线修改GTID模式
    官方online ddl
    pt-osc原理
    pt-osc使用方法
    python基本数据类型
    第一句python
    搭建私有云kodexplorer
    frp搭建
    Linux下快速分析DUMP文件
  • 原文地址:https://www.cnblogs.com/mill2002/p/1189232.html
Copyright © 2011-2022 走看看