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 %>
     


  • 相关阅读:
    jdbc preparedstatement 调用存储过程的问题
    httpclient 优化
    httpclient 4种关闭连接
    Cloudstack介绍(一)
    Docker registry私有仓库(七)
    Docker生产实践(六)
    python装饰器
    Docker镜像构建(五)
    python 生成器和迭代器介绍
    Docker数据管理(四)
  • 原文地址:https://www.cnblogs.com/mill2002/p/1189232.html
Copyright © 2011-2022 走看看