0
  • I don't know anything about Java.
  • I do know MVC.
  • I know about HTML.

My friend gave me this project made in GGTS. He wants it to be responsive by twitter bootstrap.

I don't know how to implement bootstrap.

I would like any kind of documentation or whatever you can gave me to know how to implement bootstrap in this application.

Aoren
  • 105
  • 2
  • 13
  • 1
    Unsure if the context is correct, what version of grails, do you just want to enable bootstrap or are you talking about twitter bootstrap plugin ? do you know what bootstrap is ? a javascript / css that gets added to any old html ? http://grails.1312388.n4.nabble.com/Using-bootstrap-with-Grails-do-I-need-plugins-td4640840.html http://keaplogik.blogspot.co.uk/2012/10/grails-part-4-enhanced-ui-design-w.html – V H Jul 30 '15 at 19:40
  • Grails 2.2.4. I know what twitter bootstrap is, and I've even used it. But never did anything in Java. Yes I'm talking about Twitter bootstrap. Currently reading what you gave me! – Aoren Jul 30 '15 at 19:51
  • at the end of the day your Java code will be represented like any old html generated site whether php ruby etc on the browser the same thing. The thing you need to put in place is the css and js files into your web-app/js web-app/css and call them up in your Resources.groovy. Thats as simple as it gets. – V H Jul 30 '15 at 19:54

1 Answers1

2

You need to add bootstrap to the plugins section of your buildconfig.groovy. Find the enclosure that says plugins { and add the following line:

runtime ':twitter-bootstrap:3.1.1.3'

That will download the modules you'll need to get bootstrap running, then in the .gsp files that you want to use bootstrap you will want to include it like so:

 <r:require modules="bootstrap"/>

which needs to go in the tag. I put it in the main.gsp and then made sure that I included that on all my subsequent pages like so:

<meta name="layout" content="main" />
Ted Delezene
  • 2,461
  • 1
  • 16
  • 32
  • It gives me the following error `| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information): - org.grails.plugins:twitter-bootstrap:3.1.1.3` – Aoren Jul 31 '15 at 15:00
  • Sometimes you have to point it to the correct maven distro: http://stackoverflow.com/questions/28692748/error-failed-to-resolve-dependencies-grails Try the accepted answer there see if that gets you up and running. – Ted Delezene Jul 31 '15 at 15:15
  • No, sorry for the delay in answering. I tried that before for another problem and tried it again and didn't work out. – Aoren Jul 31 '15 at 18:39
  • May you help me out with a manually install of the package? Like what to do and where to put everything. Any documentation will help as I know not much about this IDE but if I can learn anything that will be awesome. I already downloaded the package in the bootstrap page. – Aoren Jul 31 '15 at 18:42
  • 1
    I'm not sure where exactly to put them manually, but if it helps here is the stuff for my repositories: ` mavenRepo "http://repository.codehaus.org" mavenRepo "http://download.java.net/maven/2/" mavenRepo "http://repository.jboss.com/maven2/"` That should get what you need for the bootstrap – Ted Delezene Jul 31 '15 at 18:49