Using Bootstrap 4 with Grails

I am using Grails for a web project for a CSE class in college. I noticed that many of the other groups that make this project use Bootstrap 4 for web design (I'm in the only group using Grails). I looked into Bootstrap 4 and I really like the way it looks. Personally, I don't like how Grails looks with standard HTML. I was wondering if there is a way to use Bootstrap 4 with Grails. For example, in standard HTML, I can have a button and forms that will transmit data to the controller, and some action will happen, it looks like it's not like with Grails.

Does anyone know if I can integrate Bootstrap 4 with Grails, and if so, how can I do this?

+4
source share
3 answers

Bootstrap has nothing to do with Grails. Just include the dependencies and use the bootstrap classes in your GSP in the same way as on a regular HTML page. The tag <g:form>can be used to send to the Grails controller.

+5
source

, grails-app/assets/stylesheets/ .css, bootstrap.css grails-app/assets/javascripts/ bootstrap.js. , , . , , . grails-app/assets/javascripts/application.js grails-app/assets/stylesheets/application.css, , , require. . .

, .

+2

:

  • bootstrap-4.X.X.zip
  • .zip dist
  • Grails 3 grails-app/assets/stylesheets/boostrap.css dist/css/bootstrap.css
  • grails-app/assets/javascripts/bootstrap.js
  • dist/js/bootstrap.bundle.js grails-app/assets/javascripts
  • grails-app/assets/javascripts

:

//= require bootstrap

//= require bootstrap.bundle

:

jQuery. 2.2.0 jQuery, Grails , . Bootstrap 4 jQuery 3.X.

0

Source: https://habr.com/ru/post/1689485/


All Articles