- add route for
new_user_path - create a
UsersControllerwith new action - create
new.html.erb - generate user model with
password_digeststring field - uncomment
gem 'bcrypt'in Gemfile and addhas_secure_passwordin User model - add
createaction in UsersController - implement logic for creating a user
- set
session[:user_id]in create action
- What's the difference between Authentication and Authorization?
Authentication is to verify that the user is who he says he is; Authorization is to validate if the user can access certain paths/actions or not (what do you have privilege to).
- Why are both necessary for securing our applications?
They are both needed because they validate different things inside an application, so we want the right people to access the right information.
Scenario: I do a pull request at work of a feature that includes a callback, and my supervisor calls me and tells me they don't usually use callbacks and he wants me to explain my reasoning behind it.
After our research, I would only use before_save (and maybe before_destroy); and I would use them to prepare or modify an object before saving or deleting that specific object from my database (I wouldn't chain another object to that callback). Callback methods can be very useful but must be used with care, keeping in mind to use a callback only when to operate on the object itself (not to create relationships with others), with a single resposibility, and when I know I always want to run that specific action - every time in every circumstance. If I know my callback fulfills the above, I would use them with confidence
By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.
-
Date of feedback conversation:
- may 10th 2017
-
How did you prepare for the conversation?
- Thinking on what everyone wants to achieve (finishing project, extension, learn a specific thing)
- How can we make the best use of everyone's skill
-
How did the conversation go for you? What was easy about the conversation? What was more difficult?
-
What are you doing well as a pair programmer and collaborator?
- According to my Johari Window, I'm communicative, intelligent, positive, hardworking, collaborative, confident, responsible, able, adaptable (4 to 6 people agreed - including me).
- I like that people see these values in me, because I feel it makes me a good team member, I'm capable to do the work and I'm also able to communicate and collaborate well with others (which sometimes is the most difficult part).
-
How do you use your strengths as a team member?
- One of my strengths is Harmony, and I think that is reflected in my feedback; I like and I try for people to be comfortable working with me and have the confidence to speak their mind.
- What project management strategies did you use in your projects this module?
I've used agile development and waffle.io tool, in my last two projects we've started writing user stories and all the tests beforehand and doing red-green-refactoring. Because we started with the tests, we were always open to modify our tests based on adjustments or decision we took.
- What went well?
Having our test leading our development was very helpful, and even though it requires a lot of work at the beginning, when you start coding is a lot easier because you have a clear idea of what you want to build.
- What does it mean to precompile files? What does this have to do with Coffeescript and Sass files? Does it only have to do with Coffeescript and Sass files?
Precompile: To do a preliminary conversion before doing the final conversion. The precompile phase sets up the source code, database, etc., in such a way that the final phase is performed faster.
Precompile files means to combine assets into a single file into a single language that the browser can read and so they don't need to be retrieved in separate HTTP requests. This applies for every type of language, it turns it into html and css.
- What does it mean to minify files? Why would we want to minify files?
To minify is the process of removing all unnecessary characters from source code without changing its functionality (it removes white space, new lines, comments, etc). We want to do this to reduce the amount of data that needs to be transferred (make source code "smaller" and improve performance) its lightweight and it ta
This tutorial will help guide you through the process of setting up a new Ruby on Rails project with robust testing capabilities. This tutorial makes a couple of assumptions:
- You have installed Ruby on Rails and have a rudimentary understanding of how to use it.
- You have installed bundler