So I have been trying to firstly check if the post's title is unique before posting it. In the model I added this line but it does not do what I expected:
validates_presence_of :title, uniqueness: true
Of course, I can check before making the post (in the controller) and if a post with this title exist to return an error message but is this the proper way to do it? I thought that there might be a validation for that.