STrange createLionk Result

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

STrange createLionk Result

Jonathan Rosenberg-2
I have the following in a view:

      ${createLink(controller:'category', action:'delete', id:catalog.uuid)}

The createLink is returning unexpected (to me, at least) results. But
this onloy seems to happen when thw controller is 'delete'.  In tbhis
care I get

            /Catalog/rest/catalogs?id=15

If change 'delete' to anything else, it does what I expect.  FOr example,

                 ${createLink(controller:'category', action:'deete',
id:catalog.uuid)}

returns

            /Catalog/category/deete/15

What's going on here?  Is Grails trying to do some kind of reverse
mapping using my UrlMappings.groovy file (which mentiones rest, but
not delete)?


--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: STrange createLionk Result

Jonathan Rosenberg-2
BTW: after some experimenting I determined that this IS related to the
url mappings, though I don't know how/why.  Here is my
UrlMappings.groovy

class UrlMappings {

        static mappings = {
                "/rest/node/"(controller: 'node') {
                        action = [ PUT: 'changeName' ]
                }
               
                "/rest/catalogs"(controller: 'category') {
                        action = [ GET: 'list' ]
                }

                "/rest/category/insertNew"(controller: 'category') {
                        action = [ GET: 'insertNew' ]
                }

                "/$controller/$action?/$id?"{
                        constraints {
                                // apply constraints here
                        }
                }

                "/"(view:"/index")
                "500"(view:'/error')
        }
}

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary


On Fri, Apr 1, 2011 at 5:58 PM, Jonathan Rosenberg <[hidden email]> wrote:

> I have the following in a view:
>
>      ${createLink(controller:'category', action:'delete', id:catalog.uuid)}
>
> The createLink is returning unexpected (to me, at least) results. But
> this onloy seems to happen when thw controller is 'delete'.  In tbhis
> care I get
>
>            /Catalog/rest/catalogs?id=15
>
> If change 'delete' to anything else, it does what I expect.  FOr example,
>
>                 ${createLink(controller:'category', action:'deete',
> id:catalog.uuid)}
>
> returns
>
>            /Catalog/category/deete/15
>
> What's going on here?  Is Grails trying to do some kind of reverse
> mapping using my UrlMappings.groovy file (which mentiones rest, but
> not delete)?
>
>
> --
> Jonathan Rosenberg
> Founder & Executive Director
> Tabby's Place, a Cat Sanctuary
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email