Month: January 2017

Building a Reddit Clone Pt.4

We want our users to vote up or down on someone else's link. To do so, we use the power of a gem called acts as votable. ( i found out that some gems like devise, which we used before, need a server restart to work properly as does acts as votable) Added the gem … Continue reading Building a Reddit Clone Pt.4


Building a Reddit Clone Pt.3

To avoid users from deleting links allthough not logged in, we need some authentication in the controller. We need a before filter , means before the controller starts actual work it launches starting parameters to, in this case, authenticate the user. class LinksController < ApplicationController before_filter :authenticate_user!, except: [:index, :show] we dont need users to … Continue reading Building a Reddit Clone Pt.3

Building a Reddit Clone Pt.2

We should next start to put some links into our application, to let people click on sign in and sign out links, viewing their account details and submitting links when signed in. <% if user_signed_in? %> <ul> <li><%= link_to 'Submit link', new_link_path %></li> <li><%= link_to 'Account', edit_user_registration_path %></li> <li><%= link_to 'Sign out', destroy_user_session_path, :method => … Continue reading Building a Reddit Clone Pt.2