0

Curious if this is an issue or if I'm doing something wrong. Given the following controller:

class MetaDataTypeController {
  static scaffold = MetaDataType
  static defaultAction = 'list'

  def list() {
    render("You meant ${g.link(action: 'index', '/index')}")
  }

  def index() {
    [metaDataTypeList: MetaDataType.list()]
  }
}

accessing the application at "/app/metaDataType", I would expect to see the "list" action, with a link to "index". What I see is the "index" action. If I remove the static scaffold declaration, it works and I'm shown the link.

Is this intentional? Am I just overlooking something.

Edit: typo fixed

Trebla
  • 1,164
  • 1
  • 13
  • 28

1 Answers1

0

Do as like that

class MetaDataTypeController {
  static scaffold = MetaDataType

  def index() {
        redirect(controller:'MetaDataType',action:'list')
    }

  def list() {
        [metaDataTypeList: MetaDataType.list()]
    }
Syed Sarek
  • 373
  • 2
  • 12
  • That technically works, but the example was illustrative... I don't want the scaffolded `index() ` action to redirect to `list()`. In real life, those are two separate things, and I want list to be the default action while still leveraging the scaffolded index. – Trebla Jun 22 '17 at 10:53