私は User モデルをセットアップし、restful_authenticationそれに属する Profile モデルを持っています。fields_forユーザーとそのユーザーのプロファイルを編集するためのフィールドをユーザー編集ビューに結合するために使用してきました。
in_place_editingユーザー表示ビューでプラグインを使用するためにいくつかのフィールドを設定できるようにしたいと思います。与えられた例に従って、ユーザーテーブルフィールドで正常に動作します
users_controller.rb
in_place_edit_for :user, :email
/views/users/show.html.erb
<%= in_place_editor_field :user, :email %>
in_place_editor_fieldしかし、次の方法で編集ビューでアクセスするフィールドのビューにコントローラーまたはビットを適切に書き込む方法がわかりません。
<% fields_for @up do |profile_fields| %>
<%= profile_fields.text_field :status %>
<% end %>
users_controller で (わかりやすくするために):
def edit
@user = User.find(params[:id])
@up = @user.profile
end
:user.profile, :statususers_controller や /views/users/show.html.erbなどのシンボルを作成するにはどうすればよいですか?
助けてくれてありがとう。