Month: January 2017

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