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


  • 相关阅读:
    SpringBoot与(Security)安全
    SpringBoot任务
    SSM框架整合思路
    数据库连接池 Druid和C3p0
    YAML语法:
    Mbatis使用
    为什么要使用Mybatis-现有持久化技术的对比
    SpringMVC拦截器
    ARC109D
    一类求斯坦纳树大小的问题
  • 原文地址:https://www.cnblogs.com/mill2002/p/1189232.html
Copyright © 2011-2022 走看看