partial form for nested models in rails 3
问题 I have two models pages and author, here is the code of model pages: edit -1 now my models are as follows: class Page < ActiveRecord::Base validates :title, :presence => true belongs_to :author end author model: class Author < ActiveRecord::Base has_many :pages end and my form is as follows: <%= form_for(@page) do |f| %> <% if @page.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@page.errors.count, "error") %> prohibited this post from being saved:</h2> <ul> <% @page.errors