Bootstrap 5 + esbuild in Ruby on Rails 7

  Рет қаралды 12,363

Mix & Go

Mix & Go

Күн бұрын

With the introduction of the new asset pipeline, many new tools are available for you to use.
So the question is, "How do you install Bootstrap in Rails 7?"
By the end of this video, you'll know two ways to install Bootstrap and how to fix a problem with the installer.
🎥 Join my new Practical Ruby on Rails For Beginners course here: mixandgo.com/r...
👉 Get my eBook: mixandgo.com/e...
Read the guide here: mixandgo.com/l...
#rubyonrails #rails7 #assetpipeline #bootstrap

Пікірлер: 59
@alexax3888
@alexax3888 6 ай бұрын
Great video, thanks for the detailed steps. I installed this on an existing ror app and after finishing the steps from the video I got the error "Error ActionView::Template::Error (Asset `application.js` was not declared to be precompiled in production." I could fix this by running the rails javascript:install:esbuild command again.
@padavanocskos
@padavanocskos Жыл бұрын
It's a very useful!
@mixandgo
@mixandgo Жыл бұрын
Thank you
@raulhespinosa
@raulhespinosa Жыл бұрын
Great video, I have exactly the same thing and dropdowns still not working...
@mixandgo
@mixandgo Жыл бұрын
Thank you Raul. What isn't working?
@JonathanVANDERBOSSE
@JonathanVANDERBOSSE 11 ай бұрын
Actually creating a new rails app doesn't work with bootstrap + esbuild. Asset pipeline Propshaft or Sprocket choice doesn't matter.
@EstoyProgramando
@EstoyProgramando 2 жыл бұрын
Thanks, last time I worked on Ruby on rails 5 and now i have no idea what the hell happened to the asset pipeline. Keep going!
@mixandgo
@mixandgo 2 жыл бұрын
There are new tools available now. Better tools ;)
@gono_bf1
@gono_bf1 Жыл бұрын
I keep getting this error in development: Asset `application.js` was not declared to be precompiled in production. Declare links to your assets in `app/assets/config/manifest.js`. Not sure what to do, because if I include the application to the manifest file, the dropdown keeps not working.
@mixandgo
@mixandgo Жыл бұрын
Hi Victor. No idea without some context.
@ansellgabrieldelayre2630
@ansellgabrieldelayre2630 Жыл бұрын
i have the same issue
@ansellgabrieldelayre2630
@ansellgabrieldelayre2630 Жыл бұрын
Asset `application.js` was not declared to be precompiled in production. Declare links to your assets in `app/assets/config/manifest.js`.
@mixandgo
@mixandgo Жыл бұрын
@@ansellgabrieldelayre2630 have you looked at the article? mixandgo.com/learn/ruby-on-rails/how-to-install-bootstrap Maybe there's something you've missed there?
@ansellgabrieldelayre2630
@ansellgabrieldelayre2630 Жыл бұрын
@@mixandgo Thank you; it is now operational.
@cakeintech
@cakeintech Жыл бұрын
This video is priceless it saved my project in under 5 minutes, Keep making these. 👏
@mixandgo
@mixandgo Жыл бұрын
Glad to hear that 💪
@fijikiji_prod
@fijikiji_prod 9 ай бұрын
Still works over a year later. Im following a course and it uses rails 6 and my app is in rails 7 and this saved me so much time. Quick and easy to follow
@mixandgo
@mixandgo 9 ай бұрын
Thank you.
@yeurys1402
@yeurys1402 9 ай бұрын
i installed using the -js esbuild --css but the functions for the bootstrap navbar wont work. been trying for a while now.. pls help
@mixandgo
@mixandgo 9 ай бұрын
This video should fix that. If you need 1:1 help, you can book a call on my website: mixandgo.com/lp/book-call.
@tofudeliverygt86
@tofudeliverygt86 Жыл бұрын
Incredible production quality and content, thank you sir!
@mixandgo
@mixandgo Жыл бұрын
You're too kind :) Thank you.
@riversummer-o1z
@riversummer-o1z 6 ай бұрын
Thanks, I meet the problem when I using 'rails new -c bootstrap app1' command. Your video help me a lot.
@matiasbg8747
@matiasbg8747 Жыл бұрын
hey! how display form in bootsrap modals?...
@mixandgo
@mixandgo Жыл бұрын
Check out this video: kzbin.info/www/bejne/jKXdhYeva5p4g7s
@RicardoAmigoViolão
@RicardoAmigoViolão Жыл бұрын
The link to the course is getting a 500 error
@mixandgo
@mixandgo Жыл бұрын
Thank you for the heads up. I've updated the link.
@mr.schway
@mr.schway Жыл бұрын
where can I add custom css code? thank you
@baingfx
@baingfx 6 ай бұрын
Thank you! It's very useful video and helps resolve my problem.
@mixandgo
@mixandgo 6 ай бұрын
Happy to hear
@farsiteguide2735
@farsiteguide2735 Жыл бұрын
Thank you for video, but Im still stuck with same problem. Dropdown work sometimes, not always. On one site is random, cant see pattern. On other site dropdown does not work after I log in, or sometimes after I log out, but if I then refresh page, drop down works fine. I would be grateful if someone can help as Im having problem with this for weeks.
@mixandgo
@mixandgo Жыл бұрын
It's probably because you are replacing the frame, instead of updating it?
@farsiteguide2735
@farsiteguide2735 Жыл бұрын
tbh Im not sure how to update frame instead of replacing. Trying to get info about it on chatgpt, what I tried didnt work and some stuff was too complicated. @@mixandgo
@justinkalish935
@justinkalish935 Жыл бұрын
Thank you! It works great! If anyone has issues just double check your files vs his. Sometimes a semicolon is added quickly. Sometimes you need to delete a little more.
@justinkalish935
@justinkalish935 Жыл бұрын
To save someone hours of work. This tutorial worked for me in the past. However, I could not get it to work today. I tried for hours. This one works. kzbin.info/www/bejne/kGPKnZ-BaNeFabc&ab_channel=BenNguyen If someone is trying to use Heroku you have to push one step at a time to get it to work.
@shuxun3451
@shuxun3451 Жыл бұрын
Thanks! Btw i have a question on a warning When i do javascript:install:esbuild it did fix the bootstrap dropdown menu but now my app gave preload error warning and make new request every page change Is it fine? Or is there any workaround?
@mixandgo
@mixandgo Жыл бұрын
No idea. It should behave as you see in the video. So if it doesn't do that, then it's not fine.
@shuxun3451
@shuxun3451 Жыл бұрын
​@@mixandgo after some dividing apparently the warning only appear after the javascript include tag on the application.html.erb, could it be because my ruby version that is 2.7.1? Or maybe conflict on turbo?
@shuxun3451
@shuxun3451 Жыл бұрын
Also on new project with esbuild and bootstrap the error didnt show but the bootstrap dropdown dont work immediately until i do the esbuild install again but the warning is back after that
@brainstorm2297
@brainstorm2297 Жыл бұрын
i am still facing that problems (The asset "application.css" is not present in the asset pipeline.) plz sove this thanks 🙏🙏
@AriefRizkyRamadhan
@AriefRizkyRamadhan Жыл бұрын
Can try run rails assets:precompile
@gnan6647
@gnan6647 Жыл бұрын
@@AriefRizkyRamadhan Awesome rails assets:precompile resolved my issue. but this command should be added to the blog. else many of us don't know how to resolve this issue. for me, it took more than 4 days (learning it in my rest time) to resolve this. :) :)
@kickedoutonthestreets
@kickedoutonthestreets Жыл бұрын
You don't have any idea how this less than 5-minute video saved my deadline... THANKS!
@mixandgo
@mixandgo Жыл бұрын
Happy to hear that :)
@gregs2274
@gregs2274 2 жыл бұрын
What about having Bootstrap and staying with importmaps? How do you do that?
@mixandgo
@mixandgo 2 жыл бұрын
There seems to be an issue atm with that setup (with Popper not working). Check out this thread: github.com/rails/importmap-rails/issues/65
@РинатИмангулов-щ5г
@РинатИмангулов-щ5г Жыл бұрын
Thank you, you're the best!
@mixandgo
@mixandgo Жыл бұрын
You're welcome :)
@RichardNavarrete1
@RichardNavarrete1 7 ай бұрын
I noticed you are using yarn 1.22.18, which is before the Yarn Plug'n Play. I upgraded to 4.10, which does use it, but it's making things difficult. For one, it adds "-load-path=node_modules" to my build:css:compile script, but does not build the node_modules folder, etc... it builds the pnp.cjs and accompanying loader. As a result, I'm getting Error: Can't find stylesheet to import. ╷ 1 │ @import 'bootstrap/scss/bootstrap'; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ directly when I try to run ./bin/rails css:install:bootstrap. I want to give PNP a try because it does sound like a good idea to embrace it, but it's not working for. What are your thoughts with that please?
@mixandgo
@mixandgo 6 ай бұрын
Haven't tried that yet. I'll let you know if I do.
@RichardNavarrete1
@RichardNavarrete1 6 ай бұрын
@@mixandgo I wound up giving up on PNP and going back go 1.22.18... much simpler. Also, I noticed that when I was using 4.10 / PNP that the console comments said it was experimental.
@mixandgo
@mixandgo 6 ай бұрын
@@RichardNavarrete1 makes sense. There are plenty of dependencies breaking in the latest versions of Rails. Adding one more doesn't sound very appealing to me :)
@CD-zd6zr
@CD-zd6zr Жыл бұрын
I keep getting /* Error: Can't find stylesheet to import. * , * 1 | @import 'bootstrap/scss/bootstrap'; * | ^^^^^^^^^^^^^^^^^^^^^^^^^^ * ' * app\assets\stylesheets\application.bootstrap.scss 1:9 root stylesheet */
@mixandgo
@mixandgo Жыл бұрын
Have you ran ./bin/rails css:install:bootstrap ? I should create that file for you.
@CD-zd6zr
@CD-zd6zr Жыл бұрын
@@mixandgo that's the command that's giving me that error
@mixandgo
@mixandgo Жыл бұрын
@@CD-zd6zr I just tried it again locally (Rails 7.0.4.2). Got no errors rails new proj_name bundle add cssbundling-rails ./bin/rails css:install:bootstrap
Introduction to Hotwire in Ruby on Rails
10:17
Mix & Go
Рет қаралды 21 М.
How to use Dev Containers in Rails 7.2
24:07
GoRails
Рет қаралды 4,4 М.
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 2,1 МЛН
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 7 МЛН
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
路飞与唐舞桐
Рет қаралды 12 МЛН
Moving away from importmaps to esbuild in Rails 7
9:27
Rapid Ruby
Рет қаралды 5 М.
5 Secrets to Becoming a Badass Ruby on Rails Developer
28:01
Mix & Go
Рет қаралды 24 М.
Switching Your Tech Stack (Rails to Laravel).  Worth it?
15:01
Brian Casel
Рет қаралды 2,6 М.
React SPA With JSX Using ESBuild In Ruby On Rails 7
14:03
Deanin
Рет қаралды 10 М.
Build an AI Chat With Ruby on Rails
15:41
Mix & Go
Рет қаралды 710
How to Install Bootstrap with NPM (Best Way)
16:47
ByteGrad
Рет қаралды 53 М.
How to add Bootstrap to Ruby on Rails 7 App - Rails 7 Tutorial 2022
12:09
How to use ESBuild with JS Bundling in Rails
15:07
GoRails
Рет қаралды 14 М.
Talking About Sass And ESBuild In Ruby On Rails 7
10:34
Deanin
Рет қаралды 3,1 М.