Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNabil Nader
8,848 PointsQuestion about ideas.hbs
I hava been stuck for so long, I know this spark tutorial about 6 years old , but i really need help
this is my index.hbs
{{#partial "content"}}
{{#if username }}
<h1>Welcome {{ username }}!</h1>
<p>View <a href="/ideas">all course ideas</a>.</p>
{{ else }}
<h1>Welcome Students!</h1>
<form action="/sign-in" method="post">
<input type="text" placeholder="What's your user name?" name="username">
<button>Sign in</button>
</form>
{{/if}}
{{/partial}}
{{> base.hbs}}
}
and this is ideas,hbs
{{#partial "content"}}
<h1>Current Ideas</h1>
<ul>
{{#each ideas}}
<li> {{ title }}
</li>
{{/each}}
</ul>
<form action="/ideas" method="post">
<input type="text" placeholder="What's your idea?" name="title">
<button>Suggest!</button>
</form>
{{/partial}}
{{> base.hbs}}
and this is java Main
get("/ideas", (req, res) -> {
Map<String, Object> model = new HashMap<>();
model.put("ideas", dao.findall());
return new ModelAndView(model, "ideas.hbs");
}, new HandlebarsTemplateEngine());