Open xtrasmal opened 11 years ago
I created a new header.tpl.php just for the SingleView. This was needed, because Lab.js was looking for the javascripts relative to the message/1. So I change this:
<script type="text/javascript">
$LAB
.script("//code.jquery.com/jquery-1.8.2.min.js").wait()
.script("bootstrap/js/bootstrap.min.js").wait()
.script("bootstrap/js/bootstrap-datepicker.js")
.script("scripts/libs/underscore-min.js").wait()
.script("scripts/libs/underscore.date.min.js")
.script("scripts/libs/backbone-min.js")
.script("scripts/libs/jquery.scrollIntoView.min.js")
.script("scripts/app.js")
.script("scripts/model.js").wait()
.script("scripts/view.js");
</script>
To this:
<script type="text/javascript">
$LAB
.script("//code.jquery.com/jquery-1.8.2.min.js").wait()
.script("../bootstrap/js/bootstrap.min.js").wait()
.script("../bootstrap/js/bootstrap-datepicker.js")
.script("../scripts/libs/underscore-min.js").wait()
.script("../scripts/libs/underscore.date.min.js")
.script("../scripts/libs/backbone-min.js")
.script("../scripts/libs/jquery.scrollIntoView.min.js")
.script("../scripts/app.js")
.script("../scripts/model.js").wait()
.script("../scripts/view.js");
</script>
The key to that is at the top of the page, the "base" property which is set based on the "application root url" when you generate the app. but you can change it after the fact:
<base href="http://localhost/appname/" />
The single view shows me the correct JSON, but the SingleView does not render. Do I need to set extra options? /api/message/1 works. Is there something that needs to change to the model for the single view underscore output?