config/routes.cfm, you'll see something like this:
widgetscontroller with a
newaction, we could link to it like this:
routes.cfmand understand what the names and parameters are. Of course, this View Routes functionality is a great tool too.)
widgets, it's fairly simple:
routeargument. That will generate these links:
widgetroute requires an extra step because it has that
[key]parameter in its pattern. You can pass that parameter into
linkToas a named argument:
config/routes.cfm, the key is to inspect the routes generated and get a feel for the names and parameters that are expected.
rolesresource, you would prefix it with the namespace name:
editroutes add the action name to the beginning of the route name:
pagesresource, you add the parent resource's singular name first (e.g., the parent
websiteis added, making the route name
POSTin the browser.
GETrequests, so we need to work around this.
DELETEmethod, we need to code the link up as a simple form with submit button:
classes that you prefer in your markup, of course).
putas well as
id, rel, onclick, etc.
<a>tag is easy enough, isn't it? Why would we need to use a function to do this mundane task? It turns out that there are some advantages. Here's the deal.