How to build a Reddit or Hacker News Style Web App in Rails 4

Mackenzie Child · 212K views · 2014 · 1:08:07

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a beginner Rails tutorial, and many questions come from people following it who hit errors with routes, Devise and acts_as_votable.

Recommended by 2 people across 2 different months, 2015 to 2018.

What it is

A 68-minute screencast by Mackenzie Child, the first video in his 12 Web Apps in 12 Weeks series, building a Reddit or Hacker News style link aggregator in Ruby on Rails 4. It uses Devise for authentication and acts_as_votable for upvotes, and the code is on GitHub as the 'raddit' app.

What people said

Recommends wyattwade · 2015-10 · Stack Overflow · on “What coding language do I need to learn to make a widget builder?”

Do you know any html, css, or javascript? These are essential in creating just about any custom web content. Also, have you considered following along on some youtube tutorials? Here are some that really helped me out in using different rails gems when I was starting out: [this video] And finally, Michael Hartl's tutorial : [LINK] Hartl actually builds a twitter app . Incredible tutorial but it can take months. He uses very little external libraries. This is considered one of the best web application tutorials ever made. Good luck!

Recommends xpnimi · 2018-04 · Stack Overflow · on “Rails - Best practice to have completely two different designs”

You can do it in one rails application. Use a static_pages controller for your marketing sites, and use devise for user authentication. with devise you can use before_action :authenticate_user! for your dashboard controller, to limit access only to logged in users. You also may want to read Michael Hartls Book about building Ruby-On-Rails applications. [LINK] and have a look at Mackenzie Child's 12 in 12 challenge. [this video]

Cites joeyk16 · 2015-02 · Stack Overflow · on “No route matches [GET] "/links/1/like" - Ruby On Rails”

Hello im doing [this video] and im up to 50.07min. Im new to ruby. Been studying for 3 weeks. I just loaded Acts As Votable Gem. Loaded it as per instructions. I was able to add an upvote using ruby console. So it seems to work. However. When i click upvote I get this error No route matches [GET] "/links/1/like" You can see an image of it at this link [LINK] Below is my views>links>index.html.erb <% @links.each do |link| %> <div class="link row clearfix"> <h2> <%= link_to link.title, link %><br> <small class="author">Submitted <%= time_ago_in_words(link.created_at) %> by <%= link.user.email %></small> </h2> <div class="btn-group"> <a class="btn btn-default btn-sm" href="<%= link.url %>">Visit Lin

Cites idjuradj · 2015-09 · Stack Overflow · on “No route matches [GET] "/links/1/like" with acts_as_votable”

I'm trying to implement acts_as_votable gem as shown in this this tutorial [this video] Seems everything is workigng fine, except when I click on upvote or downvote, I get this error: No route matches [GET] "/links/1/like" This is the code for upvote / downvote function <span class="upvote"> <%= link_to like_link_path(link), method: :put, class: "upvote-image" do %> <% end %> </span> This is the routes.rb file: resources :links do member do put "like", to: "links#upvote" put "dislike", to: "links#downvote" end resources :comments end Here are the upvote and downvote actions in links_controller def upvote @link = Link.find(params[:id]) @link.upvote_by current_user redirect_to :back end def downvot

Cites Faith Tarcova · 2016-03 · Stack Overflow · on “Getting current_user undefined method while using devise gem - Ruby on Rails 4.1.5”

I'm following tutorial: [this video] I already did Pintrest clone using devise gem and had no issue. When I try to add current_user to links controller I get "undefined method current_user". I tried everything... even redoing the app from scratch, defining current_user, resetting the database. I guess the gem should handle the method automatically, right? Here are my steps: 1. Generate new app - rails new raddit 2. Generate scaffold: rails g scaffold link title:string url:string 3. rake db:migrate 4. add gem 'devise', '~> 3.3.0' to gem file and run bundle install 5. run rails g devise:install 6. add file to development.rb - config.action_mailer.default_url_options = { host: 'localhost', port: 300

Cites iiRosie1 · 2018-01 · Stack Overflow · on “Link to new link”

I am following a tutorial [this video] where we build a Reddit-like application. When you click on Visit URL button, it should get you to the link that the user entered (Example: Name: Stack Overflow Link: [LINK] ) instead of it going to stack overflow's website, it would be [LINK] . I am using cloud 9, ruby on rails, and I think there is a problem on my show page. This is what it looks like: [LINK] And then here is the show page: [LINK] This is my show page: <div class="page-header"> <h1><a href="<%= @link.url %>"><%= @link.title %></a><br> <small>Submitted by <%= @link.user.email %></small></h1> </div> <div class="btn-group"> <%= link_to 'Visit URL', @link.url, class: "btn btn-primary" %> </div