How does Grails know to apply a “layout” to pages it renders?

The <meta name=”layout” content=”main”> tag includes the layout in the gsp page. You can view the grails-app/views/layouts/main.gsp to view and modify the layout. You can copy main.gsp to mymain.gsp, modify it, then change layout entry in the gsp page to reference mymain.gsp instead of main.gsp and experiment with customizing your layout preserving your ability to … Read more

Grails controller rendering method render vs respond

The respond method uses content negotiation to respond with the most appropriate content type based on the requests ‘ACCEPT’ header. Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8, application/json This way the consumer of your site can choose how they wish to be returned data. This may not be the best option if you want to force a … Read more

What does it mean for a programming language to be “on rails”?

To address your confusion with the metaphor (though it has been answered in other words under your question): Groovy is to Grails as Ruby is to Ruby on Rails, but what does that mean? Grails was a web framework built on/with the Groovy programming language to do the same thing for Groovy that Rails (a … Read more

Can I run a single unit test from the command line for a Grails project?

Possibilities of things that might be wrong with your setup: Your command order is incorrect. What works for me is: grails test-app -unit Foo (where my test class is FooTests.groovy) You aren’t explicitly importing grails.test.GrailsUnitTestCase. I had some problems with it recognizing my tests when I didn’t import this. When I was extending GroovyTestCase, things … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)