The method new was not found in component
/Library/WebServer/Documents/bookstore/app/model/Book.cfc.
Ensure that the method is defined, and that it is spelled correctly.
The error occurred in
/Library/WebServer/Documents/bookstore/app/controllers/BookController.cfc:
line 8
Called from <generated>: line 1
Called from
/Library/WebServer/Documents/ColdMVC/app/util/RouteDispatcher.cfc: line 286
Called from
/Library/WebServer/Documents/ColdMVC/app/util/RouteDispatcher.cfc: line 249
Called from
/Library/WebServer/Documents/ColdMVC/app/util/RouteDispatcher.cfc: line 81
Called from <generated>: line 1
Called from
/Library/WebServer/Documents/ColdMVC/app/util/EventDispatcher.cfc: line 106
Called from /Library/WebServer/Documents/ColdMVC/index.cfm: line 2
Called from /Library/WebServer/Documents/bookstore/public/index.cfm: line 1
6 : {
7 : function add() {
8 : params.book = _Book.new();
9 : }
10 : }
In BookController.cfc, this is what I have:
/**
* @extends coldmvc.Controller
*/
component
{
function add() {
params.book = _Book.new();
}
}
And in add.cfm:
<cfoutput>
<c:form action="save" bind="book">
<c:input name="title" />
<c:input name="author" />
<c:textarea name="description" />
<c:submit label="Add Book" />
<a href="#linkTo({action='list'})#">Back to List</a>
</c:form>
</cfoutput>
Where is the method new supposed to be defined?
--
Lola J. Lee Beno
LinkedIn: http://www.linkedin.com/in/lolajleebeno
Facebook: http://www.facebook.com/profile.php?id=714355583
Blog: http://www.lolajl.net/blog/
Yes . . . I was able to create the table in the database so Book.cfc is
working. This is what I have:
/**
* @persistent true
* extends coldmvc.Model
*/
component
{
/**
* @fieldtype id
* @generator increment
*/
property id;
property title;
property author;
property description;