Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect database to view engine #12

Open
martingaston opened this issue Aug 24, 2018 · 0 comments
Open

Connect database to view engine #12

martingaston opened this issue Aug 24, 2018 · 0 comments

Comments

@martingaston
Copy link
Collaborator

Model and Controller:

if (req.session.user && req.cookies.user_sid) {
res.render("profile");

Change to res.render("profile", { obj }); and before that make a dbQuery.getFacster() call to get that data - it looks like we'll have to nest that in a callback, too.

Views:

<div class="profile-div">
<!-- add info in from data object -->
<img class="profile-image" src="/images/emilyrever.jpg" alt="image">
<h3>Emily Rever</h3>
<ul>
<li><h4>FAC14</h4></li>
<li><h4>GitHub</h4></li>
<li><a href="https://github.com/EmilyScripts"><img class="github-icon" src="/images/github.png"></a>
</li>
</ul>
<div class="textarea"><h4>bio:</h4></div>
</div>

Replace dummy data with relevant {{ handlebars }} data from our object - we can also dummy the object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant