How I start EVERY Rails app (pt. 1)
HTML-код
- Опубликовано: 14 ноя 2022
- In this video I show you how I set up a Rails app from scratch to use RSpec, Devise and Tailwind CSS.
The source code for this lesson is available here: github.com/phawk/youtube-rail...
---
Has this video helped you out? Consider buying me a coffee to say thanks and support future content like this, thanks!
app.payhere.co/rapid-ruby/buy...
You can also find more content like this, including premium courses and exclusive community and mentorship to help you level-up! Head over to rapidruby.com and use the code RRRUclips for a discount! - Наука
Hi Pete, I don't know if I mentioned this already, but here goes it:
I'm a Laravel developer and have never built anything more than a simple blog with Rails.
But guess what? I watch your videos, EVERY SINGLE one of them.
I like the way you explain concepts and show your thought process. I take some of your ideas and opinions and translate them to my Laravel apps/projects.
You're a great teacher and your produce great videos.
If I could subscribe to your channel 1000x, I would!
Take care and stay awesome✌🏿
Thanks so much Teena! I'm glad you are getting value from them even though you aren't developing in rails. I used to use laravel quite some time ago, it's a great framework! Hopefully you'll like part two of this series where it's mostly focussed on Tailwind CSS :)
Great stuff mate! I need to setup a doc like the one you are using for starting apps, really handy
Hugely helpful - thank you so much for posting this video and part 2.
Just stumbled on this video and gotta say, its amazing! About to binge watch all your vids
Stumbled across your channel recently, big fan of your videos. I hope you continue to create more content
Thanks Alexis!
Excellent video!
I'd like to see how you also design your app/db and gather the business requirements things like that, modeling relationships etc.
You are amazing man. Thanks
early grats on 1k
Thanks for the video. Two questions,
a. how do you link the login and register to use auth.html.erb and not the default layout application.html.erb? Do you also recommend to have separate layouts like your video?
b. Is there a reason to favor esbuild over importmap?
Thanks.
Hey Eric!
A) you put “layout ‘auth’” into your controller for signups and sign ins.
B) yeah, I made a video on migrating to esbuild and explain in that why I made the switch, I hope that helps!
@@rapid-ruby I looked into the controllers folder, I could see only application_controller.rb and pages_controller.rb (also concerns folder). Wonder how come it knows how to use the auth.html.erb layout instead? I can't find the "layout 'auth'" codes if based on part I and II videos.
Have you updated your setup?
also , when you start a project do you mkdir X , cd X , git init y , cd y and then start the rails new z project? or ?
I have a folder that I keep all my projects in `~/Sites`, so I go there, and just run `rails new name` and then `cd name`, Rails creates a git repo for you. Hope that helps!
I have a problem:
The asset "application.css" is not present in the asset pipeline.
In the line:
Same version ruby and rails that you used. I dont know why this error :(
you have to install classic.yarnpkg.com/lang/en/docs/install
How do you seperate the views and layouts folders? Did you copy paste everything from application controller into auth.html.erb? For me the auth.html.erb file was with white text, didn't register or something..
To follow along with the code in this episode, just copy all the stuff across to auth.html.erb from application.html.erb. In my actual projects I tend to create a file in `app/views/layouts/partials/_head.html.erb` to share the code between them, and then load that partial in each layout. Hope that's useful!
@@rapid-ruby why didnt you name your layout 'devise.html.erb' (the same as the controller name) ? That way you would be going with the convention.
Because I don’t want to name any of my code the names of the underlying gems if I can avoid it, for me auth.html.erb makes the most sense for the job I’m using it for. Also I’m no longer using devise in as many projects going forward, but I’m still calling my layouts auth.html.erb by my own convention. Hope that helps :)
@@rapid-ruby I still think that when you are using devise, that’s a good idea to use layout named devise, because that’s the name of the controller and you don’t need any additional configuration. Convention over configuration as you’ve probably heard. Keep up the good work with videos :)
As far as I know, you would still need to set the layout manually, Rails will always default to application.html.erb, no?
Does this work on rails 7 ?
Yeah, this is a Rails 7 app :)
@@rapid-ruby Cool thanks. Applying to junior rails dev jobs soon so it's cool for you to make this vid haha. Thanks