Database Reference
In-Depth Information
Updating a User
To access the page for updating a user, click on the “User Settings” link in the social graph section, as shown in
Figure 8-8 . In this example, the front-end code uses an AJAX request via PUT and inserts—or, in the case of the
ajordan user, updates—the first and last name of the user.
Figure 8-8. The User Settings page
User Update Form
The user settings form is located in {PROJECTROOT}/app/templates/graphs/social/user.mustache and is similar
in structure to the other forms presented in the Sign Up and Login sections. One difference is that we have added the
value property to the input element as well as the variables for displaying the respective stored values. If none exist,
the form fields will be empty (Listing 8-22).
Listing 8-22. User Settings Form
<form class="form-horizontal" id="userform">
<div class="form-group">
<label for="firstname" class="col-sm-2 control-label">First Name</label>
<div class="col-sm-10">
<input type="text" class="form-control input-sm" id="firstname" name="user.firstname"
value="{{user.firstname}}" />
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-2 control-label">Last Name</label>
<div class="col-sm-10">
<input type="text" class="form-control input-sm" id="lastname" name="user.lastname"
value="{{user.lastname}}" />
</div>
</div>
 
Search WWH ::




Custom Search