Grails
  1. Grails
  2. GRAILS-8668

Scaffolding ignores overridden views without layouts

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0 final
    • Fix Version/s: None
    • Component/s: Scaffolding
    • Labels:
      None
    • Testcase included:
      yes

      Description

      Grails 2 will not let you override a view in scaffolding that you don't want to be decorated by sitemesh.

      If your (show) view looks like this:

      <html>
        <body>
          <h1>Hello World</h1>
        </body>
      </html>
      

      Then grails will ignore this and try to show the normal (scaffold) show page, but it wont look right as sitemesh is not applied to it.

      You can work around it by given it a dummy layout name like this:

      <html>
        <head><meta name="layout" content="none"></head>
        <body>
          <h1>Hello World</h1>
        </body>
      </html>
      

      But if you do not have a layout called "none" then you will get an exception:

      Message: /path/to/grails/src/grails/templates/scaffolding/none.gsp (No such file or directory)
      

      To reproduce, run the attached project and create both of the domain objects, one will show the correct page, but the other will not.

        Issue Links

          Activity

          Hide
          Lari Hotari added a comment -

          the duplicate issue GRAILS-9183 has some good comments.

          Show
          Lari Hotari added a comment - the duplicate issue GRAILS-9183 has some good comments.

            People

            • Assignee:
              Lari Hotari
              Reporter:
              James Cook
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Last Reviewed:

                Development