app/models/user.rb
has_one :user_detail
app/models/user_detail.rb
belongs_to :user
unit_number
is attribute of user_detail.
I want to edit inline this attribute in user show page.But I can't understand how I do it.
<%= best_in_place user, :unit_number %>
It gives an error.How I do it?
Please try this:
<%= best_in_place user.user_detail, :unit_number, path: user_detail_path %>
Where user_detail_path
is the update user detail path. You have to define this routes from routes.rb.