logo
down
shadow

Best practices for using Hg with Grails?


Best practices for using Hg with Grails?

By : Ben Tongue
Date : November 22 2020, 07:01 PM
it should still fix some issue Here's the .hgignore directory I've got on my most recent grails project (with a couple of project specific things taken out):
code :


Share : facebook icon twitter icon
Best practices for grails index page

Best practices for grails index page


By : JustMe
Date : March 29 2020, 07:55 AM
Hope this helps I won't claim that this is the right way, but it is one way to start things off. It doesn't take much to have a controller be the default. Add a mapping to UrlMappings.groovy:
code :
class UrlMappings {
    static mappings = {
      "/$controller/$action?/$id?"{
            constraints {
                // apply constraints here
            }
        }
      "500"(view:'/error')
     "/"
        {
            controller = "quote"
        }
    }
}
class QuoteController {

    def index = {
        ...
    }
}
def index = {
    redirect(action: random)
}
class QuoteController {

    def quoteService

    def index = {
        redirect(action: random)
    }

    def random = {
        def randomQuote = quoteService.getRandomQuote()
        [ quote : randomQuote ]
    }
}
Grails GORM best practices

Grails GORM best practices


By : Jan Macek
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further There is some great information available from the GORM Gotchas series. It's in three parts.
GORM Gotchas (Part 1)
Grails GORM Inheritance best practices

Grails GORM Inheritance best practices


By : harijs.me
Date : March 29 2020, 07:55 AM
wish help you to fix your issue It would appear you are missing the all important tablePerHierarchy mapping value for domain classes. I highly recommend you read the Inheritance Strategies documentation regarding this.
From the documentation:
code :
class Payment {
    Integer amount
    static mapping = {
        tablePerHierarchy false
    }
}

class CreditCardPayment extends Payment {
    String cardNumber
}
Resources for Grails Best Practices

Resources for Grails Best Practices


By : Rodel Tancio
Date : March 29 2020, 07:55 AM
help you fix your problem This InfoQ article on Grails best practices has an excellent list of how to split logic between controllers/views/services/domain, testing, config and other Grails specific considerations.
It's a short article and I'd recommend it to any Grails developer
Best practices for passing params in Grails 3

Best practices for passing params in Grails 3


By : Nishanth12
Date : March 29 2020, 07:55 AM
it fixes the issue params in Grails do a good job. However, I would suggest that you consider using command objects. Command objects are like Grails domains but they do not persist data in a physical database. You can easily pass the instantiated command object to the external groovy class (in the src folder) instead of passing params.
You can find more details here: http://guides.grails.org/command-objects-and-forms/guide/index.html
shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk