0

I am new in Grails. I start learning Grails before 3 days. I want to use twitter bootstrap in my sample Grail application. I am following this tutorial

I added runtime ':twitter-bootstrap:2.3.2' in my grails-app/conf/BuildConfig file.

Here is my list.gsp file where I want to use bootstrap.

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
  <head>
    <title>My Posts</title>
    <r:require modules="bootstrap"/>
  </head>
  <body>
  <g:link controller="post" action="edit">
        Create a new post
  </g:link>
  <div class="well"> 
  <h1>My Posts</h1>

  <g:each in="${posts}" var="post">
    <div>
      <h2>${post.title}</h2>
      <p>${post.teaser}</p>
      <p>Last Updated: ${post.lastUpdated}</p>
      <g:link controller="post" action="edit" id="${post.id}">
            Edit this post
      </g:link>
      <g:link controller="post" action="view" id="${post.id}">
         View this post
      </g:link>
  </div>
  </g:each>
 </div>
 </body>
 </html>

Here is my plugin list

plugins {
    runtime ":hibernate:$grailsVersion"
    runtime ":jquery:1.8.3"
    runtime ":resources:1.2"
    runtime ':twitter-bootstrap:2.3.2'

    // Uncomment these (or add new ones) to enable additional resources capabilities
    //runtime ":zipped-resources:1.0"
    //runtime ":cached-resources:1.0"
    //runtime ":yui-minify-resources:0.1.5"

    build ":tomcat:$grailsVersion"

    runtime ":database-migration:1.3.2"

    compile ':cache:1.0.1'
}

Its not working. I am completely new in Grails. I don't know why it is not working. please help..

Free-Minded
  • 5,322
  • 6
  • 50
  • 93

1 Answers1

3

Add to list.gsp

<meta name="layout" content="main"/>

and change main.gsp in layout folder like in this example

uladzimir
  • 5,639
  • 6
  • 31
  • 50