Advertisement
djuggler

CFWheels Hello Database error

Apr 19th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. controllers/Users.cfc
  2.  
  3. <cfcomponent extends="Controller">
  4.  
  5. <cffunction name="new">
  6.  
  7. <cfset user = model("user").new()>
  8.  
  9. </cffunction>
  10.  
  11. </cfcomponent>
  12.  
  13. views/users/new.cfm
  14.  
  15. <cfoutput>
  16.  
  17. <h1>Create a New User</h1>
  18.  
  19. #startFormTag(action="create")#
  20.  
  21. <div>#textField(objectName="user", property="name", label="Name")#</div>
  22.  
  23. <div>#textField(objectName="user", property="email", label="Email")#</div>
  24.  
  25. <div>#passwordField(objectName="user", property="password", label="Password")#</div>
  26.  
  27. <div>#submitTag()#</div>
  28.  
  29. #endFormTag()#
  30.  
  31. </cfoutput>
  32.  
  33. config/settings.cfm
  34.  
  35. <cfscript>
  36. /*
  37. If you leave these settings commented out, CFWheels will set the data source name to the same name as the folder the application resides in.
  38. */
  39.  
  40. set(dataSourceName="tablename");
  41. set(dataSourceUserName="username");
  42. set(dataSourcePassword="gibberish");
  43.  
  44. /*
  45. If you leave this setting commented out, CFWheels will try to determine the URL rewrite capabilities automatically.
  46. The "URLRewriting" setting can bet set to "on", "partial" or "off".
  47. To run with "partial" rewriting, the "cgi.path_info" variable needs to be supported by the web server.
  48. To run with rewriting set to "on", you need to apply the necessary rewrite rules on the web server first.
  49. */
  50.  
  51. // set(URLRewriting="partial");
  52. </cfscript>
  53.  
  54. url: https://localhost/tablename/index.cfm/users/new
  55.  
  56. Output:
  57.  
  58. Wheels.ObjectNotFound
  59.  
  60. CFWheels tried to find the model object user for the form helper, but it does not exist.
  61. Error location
  62.  
  63. Line 7 in views\users\new.cfm
  64.  
  65. 5: #startFormTag(action="create")#
  66. 6:
  67. 7: <div>#textField(objectName="user", property="name", label="Name")#</div>
  68. 8:
  69. 9: <div>#textField(objectName="user", property="email", label="Email")#</div>
  70.  
  71. Tag context
  72.  
  73. Error thrown on line 534 in wheels\view\miscellaneous.cfm
  74. - called from line 247 in wheels\view\forms.cfm
  75. - called from line 303 in wheels\view\forms.cfm
  76. - called from line 25 in wheels\view\formsobject.cfm
  77. - called from line 7 in views\users\new.cfm
  78. - called from line 128 in wheels\global\cfml.cfm
  79. - called from line 434 in wheels\controller\rendering.cfm
  80. - called from line 157 in wheels\controller\rendering.cfm
  81. - called from line 53 in wheels\controller\rendering.cfm
  82. - called from line 140 in wheels\controller\processing.cfm
  83. - called from line 95 in wheels\controller\processing.cfm
  84. - called from line 198 in wheels\dispatch\request.cfm
  85. - called from line 1 in wheels\index.cfm
  86. - called from line 1 in index.cfm
  87. - called from line 1 in wheels\events\onrequest.cfm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement