![]() ![]() Hello Rails is a modern course designed to help you start using and understanding Ruby on Rails fast. 04 - Build a Twitter clone - You are here.Music credit in part 2 - The Series So Far As we press forward I plan to introduce more concepts and ideas for app builds of which you could make on your own. I hope you enjoyed the build as much as I did. I may even do so myself as time carries on just to resolve some bugs I spotted along the way as well as integrate new technologies and features into the mix. You are welcome to extend this project further. We didn't build a fully functioning Twitter clone but we did take bits and pieces to create something similar. On top of the previous build, I went one step further and introduced authentication and user roles. The main purpose of this build was to reintroduce techniques and terminology used in the previous build. Feel free to extend/modify this to your liking. I noticed after the fact that the the form doesn't necessarily need so many required fields. It's up to you what you want to "require" from a user. You will want to repeat this change on the file in the same directory. Here I make use of Bulma as well as add our name and username fields to the form. I needed to create a registrations controller which contains the following: # app/controllers/registrations_controller.rb In my case, I added the name and username fields to the registration process. To add any additional fields to the Devise model you use, this step is 100% required. I definitely invite you to check it out to understand it a bit better yourself. I referenced a blog post which helped me wrap my head around what's really going on. Gravatar_image_tag - Integrated image tag which spits out gravatars.Īs promised in the video I talk about extending the Devise gem to bypass the default registrations controller and apply our own. Guard is required for the Guard LiveReload gem to workĭevise - Effortless user roles and authentication Guard - Useful for live reloading our scss, js, css, and erb files, although it's capable of much more! Feel free to roll your own styles and/or use a different framework. I may revisit this series to extend and address these issues. See if you can find a way to only allow the current logged in user to edit their own tweets and not other users. This is a big security flaw as a user's abilities should only lie within their own account. Note: One big error I noticed after calling it quits on this build was that any logged in the user could edit any other user's tweeets. There are also a few gems in the wild for "liking" posts. I may revisit this app to add more features to another exercise but I truthfully ran out of time! Let me know if you'd like to see me extend this further. (Tip: It's the same as adding comments to the blog post as I did in the previous build ) ). Similar to the blog with comments build I did, see if you can figure out how to add replies to the application on your own. Instead, I invite you to tinker with how to possibly add those features. I won't be covering replies, retweets, likes, and quite a few other foundational features of the famous social media giant. Twitter is a pretty elaborate application. Users that have an account can log in to create their own Tweeets to add to the public stream. The end result is a public-facing site with a stream of tweets from different users. A user's Tweeets are then also tied to their account. Combined with this gem we can authenticate users who want to author Tweets. On top of the Tweeets, I introduce a new gem called Devise which makes creating an entire user role and authentication system easy. In essence, this is the same as my previous build where we created posts for a blog. The app itself will feature a basic CRUD principle where we can create, read, update, and destroy Tweeets. Download the source codeĭownload the source code What we are building If you haven't watched the first Let's Build, I invite you to do so in order to understand what we are doing. We'll make use of Rails generators to help scaffold some of the things I've already covered. I'll be going a bit faster than the previous build as it was more of a foundational exercise where I explained common concepts revolving around the Ruby on Rails ecosystem. This app will most notably demonstrate a user role system giving your web application and native application feel all within the browser. We will be creating a knock-off of sorts called Twittter. ![]() Welcome to our next Let's Build! This build introduces a well known social media giant Twitter into the mix as inspiration for the project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |