Wheels View Generator

Generate CFWheels view templates with correct query handling and form helpers.

203|108|Updated Jan 13, 2011
One-click install
npx skills add https://github.com/wheels-dev/wheels --skill wheels-view-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Wheels View Generator
Source: https://github.com/wheels-dev/wheels/tree/main/.claude/skills/wheels-view-generator
Command: npx skills add https://github.com/wheels-dev/wheels --skill wheels-view-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation of CFWheels view templates, ensuring proper query handling, correct form helper usage, and accurate association display. It prevents common view errors like query/array confusion and incorrect form helper usage, allowing you to build dynamic UIs efficiently.

Core Features & Use Cases

  • View Template Generation: Creates index, show, and form views, layouts, and partials.
  • Correct Data Display: Provides best practices for displaying associated data, handling query results, and checking for record counts.
  • Form Helper Usage: Guides on using Wheels form helpers correctly, including textField() with type attributes and displaying validation errors per field.
  • Use Case: Generate an index.cfm view for Posts that lists all posts, an _form.cfm partial for creating/editing posts with validation error display, and a main layout.cfm with flash messages and navigation. This ensures your UI is functional, user-friendly, and free of common CFML errors.

Quick Start

Example Index View:

<cfparam name="resources"> <cfif resources.recordCount> <cfloop query="resources"> #linkTo(text=resources.title, action="show", key=resources.id)# </cfloop> <cfelse> <p>No resources found.</p> </cfif>

Frequently Asked Questions about Wheels View Generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a CFWheels view template that displays query results correctly?

Generate CFWheels view templates using proper query handling: use `cfparam` to declare variables, check `recordCount` before looping, and iterate with `cfloop query=` syntax. This prevents common errors from confusing queries with arrays and ensures your index or show views display data accurately.

What's the best way to create forms with validation error display in CFWheels?

Use CFWheels form helpers like `textField()` with proper type attributes and display validation errors per field. Generate `_form.cfm` partials that handle both create and edit operations, showing field-specific error messages to guide users through corrections.

How do I display associated data in CFWheels views without errors?

Display associated data by checking record counts and using correct syntax for relationship queries. The Skill generates view code that properly handles associations, preventing anti-patterns and ensuring related records render correctly in partials and layouts.

Can I use form helpers to generate RESTful form submissions in CFWheels?

Yes. CFWheels form helpers route-aware form submission through correct HTTP methods. Generated forms automatically set action, method, and key parameters to match RESTful conventions, ensuring your forms submit to the correct routes.

What view files should I generate for a CFWheels resource scaffold?

Generate index, show, and form views, plus layouts and partials. A complete scaffold includes `index.cfm` for listing, `show.cfm` for detail, `_form.cfm` for create/edit reuse, `layout.cfm` for navigation and flash messages, and helper partials for associations.