Static Layout for Ratpack

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

Static Layout for Ratpack

dbirtwell
Hello:

I just started learning Groovy (but have programmed with Java for A LONG time) and recently discovered Ratpack.

About a year ago, I took an online Ruby course and played a bit with Sinatra.

Long story short, I started to recently look at JVM languages and Web frameworks and decided to go with Groovy and eventually Grails ... but got excited when I found Ratpack. It seems like a great way to work with light Web applications with Groovy!

I am just about done porting one of my very simple Sinatra apps to Ratpack and wondered if there is a way to do a default layout template for headers/footers/sidebars like Sinatra has. If not, are there any thoughts on this.

I have to admit that I didn't look at the Sinatra code base to see how they did it with Haml and haven't yet looked at the Ratpack code base, but just thought I'd ask.

I'll probably be posting on this list a bit, being a noob to Ratback and Groovy.

BTW - Congrats to all the Ratpack developers!

Dave Birtwell
Reply | Threaded
Open this post in threaded view
|

Re: Static Layout for Ratpack

dbirtwell
If you look at my other post. I did post this port.

I had to repeat the sidebar and footer in all the template HTML files.

BTW - I used old-school HTML and CSS.

Does anyone know of a way to create static layouts, so I don't have to repeat my headers/footers/sidebars in each HTML template (and go against DRY)?

Thanks,

Dave
Reply | Threaded
Open this post in threaded view
|

Re: Static Layout for Ratpack

Luke Daley
Administrator
You can include other templates in your templates.

Here's this applied to your project: https://github.com/alkemist/tarotExampleRatpack_do_db/commit/103162543f29ac5a7fde357d79b40729d43f2eb5

I'll send you a pull request.
Reply | Threaded
Open this post in threaded view
|

Re: Static Layout for Ratpack

dbirtwell
Thanks!!!

Dave