私は 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, :status
users_controller や /views/users/show.html.erbなどのシンボルを作成するにはどうすればよいですか?
助けてくれてありがとう。