Questions tagged [cfwheels]

CFWheels provides CFML developers with a rapid MVC framework for increased productivity, organized code, and overall developer happiness.

CFWheels

CFWheels provides CFML developers with a rapid MVC framework for increased productivity, organized code, and overall developer happiness.

CFWheels is heavily based on Ruby on Rails, but it's not a direct port, and there are some things that have been changed to better fit the CFML language. The goal is to keep things simple and this shows in a lot of different areas in CFWheels.

Key CFWheels Concepts

1. Convention Over Configuration

Instead of needing to set up tons of configuration variables, CFWheels will just assume you want to do things a certain way by using default settings. In fact, you can start programming a CFWheels application without setting any configuration variables at all!

2. Beautiful Code

Beautiful (for lack of a better word) code is code that you can scan through and immediately see what it's meant to do. It's code that is never repeated anywhere else. And, most of all, it's code that you'll enjoy writing and will enjoy coming back to 6 months from now.

3. Model-View-Controller (MVC)

If you've investigated frameworks in the past, then you've probably heard this terminology before. Model-View-Controller, or MVC, is a way to structure your code so that it is broken down into three easy-to-manage pieces:

  • Model: Just another name for the representation of data, usually a database table.
  • View: What the user or their browser sees and interacts with (a web page in most cases).
  • Controller: The behind-the-scenes guy that's coordinating everything.

4. Object Relational Mapping (ORM)

The Object Relational Mapping, or ORM, in CFWheels is perhaps the one thing that could potentially speed up your development the most. An ORM handles mapping objects in memory to how they are stored in the database. It can replace a lot of your query writing with simple methods such as user.save(), blogPost.comments(order="date"), and so on.

161 questions
1
vote
4 answers

Best practice CFWheels (or RoR, or any other framework) sending email

From my research, it seems there's a general consensus that sending email is something that belongs in the Controller. So for example, if I have a signup form for People, when a user submits a signup form, I would validate the Person, and then once…
Franc Amour
  • 301
  • 1
  • 11
1
vote
1 answer

CFWheels Unit Testing?

I have searched Google and abroad and I cannot find anything about CFWheels Unit Testing. Does anyone know if it exists and if so can you point me in the right direction? Thanks, Darren
Darren
  • 10,631
  • 8
  • 42
  • 64
1
vote
0 answers

Lines of code run more than once causes concurrent transactions

Using CFWheels I sometimes get an error email stating that there was a DB error [Amazon](500310) Invalid operation: table 250818 dropped by concurrent transaction. After reading about this, it seems this can happen when a second transaction starts…
Leeish
  • 5,203
  • 2
  • 17
  • 45
1
vote
0 answers

Inheritance not working with cfinclude

I am trying to resolve an issue on CFWheels, where I am have trouble extending my parent Application.cfc which also extends another Application.cfc. In order to understand the problem better and really single out what's going wrong, I have created a…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
1 answer

CfWheels: Subqueries Solution

I am using CFWheels and trying to find a way to do subqueries. I want to know what options are available. Currently I am constructing my queries using plain old Coldfusion query and adding a huge string of the query in execution. I want to know if…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
1 answer

CFWheels: Display form errors on redirectto instead of renderpage

I have a form which I am validating using CFWheels model validation and form helpers. My code for index() Action/View in controller: public function index() { title = "Home"; forms = model("forms"); allforms =…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
0 answers

Coldfusion: Update array by passing its reference into function

I am using CFWheels and I have my action and private function as such: private function update_arr(arr) { arr[1] = "val 1.1"; arr[2] = "val 2"; } public function t_test_1() { title = "Test 1"; arr = ArrayNew(1) ; arr[1] = "val…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
0 answers

CFWheels - updateByKey() - The key argument contains an invalid value

The code above returns the following error in cfwheels: The key argument contains an…
1
vote
0 answers

Coldfusion: SQL String Query Parameter Placeholders

I am using CFWheels for my project. In my controller I have sql query string; r_query = "SELECT MAX(column) FROM user_checklist INNER JOIN rooms ON user_checklist.RID = rooms.ID INNER JOIN buildings…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
0 answers

CFWheels & Oracle 11g: Pagination on Group by data with

I am using Oracle 11g database with my CFWheels project. As known Oracle 11g doesn't support LIMIT and OFFSET. //un-grouped data data1 = model("tb_test_1").findAll(order="id"); //grouped data data2 =…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
2 answers

CFWheels: Redirect to URL with Params Hidden

I am using redirectTo() function with params to redirect to another pages with a query string in the url. For security purpose this does not look appealing because the user can change the parameters in the url, thus altering what is inserted into…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
1 answer

Coldfusion: Set function for object

I have an model object; building= model("tb_buildings"); building.myFunction() = function(){return false;}; Initially this object has no methods, I am trying to created a method for it called myFunction() and assign it a value of false; I tried…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
0 answers

CFWheels: Form helpers coding the old way not working

I have a simple form that is suppose to show one field. Controller: public function t_validate_3() { title = "Complete"; supervisor = model("supervisors").new(); } View 1: Using Form helpers…
Saad A
  • 1,135
  • 2
  • 21
  • 46
1
vote
0 answers

while updating nestedproperties record in cfwheels getting error

I have model which having many relationship with other table
1
vote
2 answers

CFWheels findAll Group By Having Clause

In CFWheels I am looking at the findAll() page and it has a group by option by doesn't have a Having Clause option. Is there a way to use having clause using findAll() in CFWheels.
Saad A
  • 1,135
  • 2
  • 21
  • 46