Routing is using ID has action and action has ID after submitting a form
- by Victor Martins
I have a model User that has_one user_profile and a User_Profile belongs_to user
in the User controller I have:
def personal
@user = User.find_by_id(params[:id])
@user_profile = @user.user_profile
@user_profile ||= @user.build_user_profile
end
def update_personal
@user = User.find_by_id(params[:id])
if…