1 1 webcamchat login
Next step let's add that username field into registration so that we can keep track of people's usernames.Editing those views with devise is really simple but because we're using bootstrap it's also something we have to go customize to fit with the bootstrap html for the forms and stuff, so actually this past weekend, one of the Gorails community members, Andrew Fomera was working with me and we we're kind of poking at the idea of what if you could just generate the views for devise that were already precompatible with bootstrap?So it's going to be interesting and there's going to be a lot to it, but we can break that up into a handful of episodes, and we'll go tackle all of those and we'll go build an actual chat application so you can get the idea of what it takes to build this bigger applications with Action Cable.Without further ado, this episode we're just going to dive into building out all the foundational stuff at a high level, so we're going to talk about building the users, the channels, the connections between users and channels so next time you log in we remember where you were at.Because both of us recognized that we would go do it once, and then go copy and paste it from another application.So he took advantage of that, and built a gem called devise-bootstrapped, which you can install in your gemfile, and this is super nice because you can say: Let's run bundle to install it, rails g devise:views:bootstraped, this will install all the views for devise but with tweaks for bootstrap so they look nice there, and then once you're done with that, you can actually remove it from your Gemfile so you don't have to keep it around, because chances are you're never going to run those generators ever again, so voila, you're done, and you have nice views, and you can see that if we now go edit settings, this is now automatically styled with some basic bootstrap stuff and even centered on the page as well, so this is pretty nifty and gives you a good starting ground for going and modifying your views.The reason why we need it as SCSS and we're using import instead of require is that this import allows you to define things like $brand-primary up here and you can set it to "red" or whatever, and this would go to apply to all of bootstrap, so it has variables in your SCSS that can get applied and so you could customize bootstrap this way, whereas if you did a require, there's no way for you to pass in SCSS variables into bootstrap in order to customize it, so we need to do that in order to make all of that work, and then I'm going to paste in some code for the application template, so that we can have two columns basically.
This is going to be a lot more complex than the DHH posts example that we saw with the Action Cable example chatroom that he built before, and it's also going to be more complicated than the notifications thing that I did which is just a tiny piece of your website.
We'll also need to set up a little bit of the UI, so I'm going to paste in a command that basically, this is from the bootstrap-sass README if you're reading that, when you set this up.
needs to be moved to because we want to use SCSS in order to parse this file.
So it needs to be something that's done server side, but we'll talk more about this in depth in a future episode, and we'll also merge that in as a feature all on it's own and so if we need to make adjustments to this model, we can go do it and then later on, and this feature can be separate, because really we're trying to set up the bare bones structure for everything right now.