I have created a Grails project. And now i want to use twitter-bootstrap. I have installed bootstrap successfully. But i want to know how to reference the following 3 links in the index.html page

<r:require modules="bootstrap" />
<r:layoutResources />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
    href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet"
    href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script
    src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
有帮助吗?

解决方案

If you have the bootstrap plugin installed you just need to call the required module

BuidConfig.groovy

compile ":twitter-bootstrap:2.3.2"

Then in your GSP

<r:require modules='bootstrap-css, bootstrap-js, bootstrap-modal, ...'/>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top