いろいろ検索してみましたが、思い通りにできません..ここに私の問題があります。
私のモデルは次のとおりです。
class User < ActiveRecord::Base
has_one :profile
accepts_nested_attributes_for :profile
end
class Profile < ActiveRecord::Base
attr_accessible :user_id, :form, :title, :name, :surname, :street, :housenumber, :zipcode, :place, :phone, :mobile, :fax, :url
belongs_to :user
end
私からしてみれば:
<% semantic_form_for @user do |form| %>
<%= form.inputs :login, :email, :password%>
<% form.semantic_fields_for :profile do |profile| %>
<%= profile.inputs %>
<% end %>
<%= form.buttons %>
<% end %>
私の問題は、人を編集すると、プロファイルにデータが表示されることです。ユーザーを作成するときでも、プロファイルのフィールドが表示されるようにします。
どうもありがとう!