Search code examples
grailstwitter-bootstrapfuelux

How can I integrate Fuel UX into a Grails project?


I have started a project in Grails and I wanted to include Twitter Bootstrap for UI but then found out about Fuel UX. Does anyone know about any example of how I could integrate Fuel UX into the grails project ?

Thanks.


Solution

  • I have not used FuelUX but integrating such libraries is as simple as including their resources into your app and include them into your pages. If you are using resources plugin in your application, it will take care of it for you. This is what twitter bootstrap and other plugins do for you.

    Copy all the required resources (js/css) from FuelUX into web-app folder and define them in your YourResource.groovy file.

    Example: YourResource.groovy

    modules = {
    fuelux {
        dependsOn 'jquery,
        resource url:'/js/core.js', disposition: 'head'
        resource url:'/js/ui.js'
        resource url:'/css/main.css', 
        resource url:'/css/branding.css'
     }
    }
    

    In your pages you can import the fuelux module, which you defined to be your required css and js. If it depends on jquery you can dependsOn it if not remove it. but include it like this in your pages:

    <r:require module="fuelux"/>
    

    If you are using this all across your pages you can define it in your layout.gsp for more information on resource plugin and how you can use it read here