Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8836729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:33:41+00:00 2026-06-14T09:33:41+00:00

I am a newbie programmer following the Michael Hartl tutorial. I was about to

  • 0

I am a newbie programmer following the Michael Hartl tutorial.

I was about to finish chapter 9, which adds the functionality to view all users at the site and delete individual ones with an admin functionality.

All specs were passing and everything working as expected, locally. However, when I tested the site at Heroku the index of the users looked different from the local index.

I tried to precompile assets before pushing to Heroku, which fixed to problem. However, now the functionality to delete users didn’t work. Instead of deleting the user, I was forwarded to that user. The same happened to the local version. Furthermore, I noticed that clicking the sign-out link returned an error:

No route matches [GET] "/signout"

All my specs are still passing which only makes it more of a mystery to me! I suspect it’s a problem with how assets are compiled, but as a rails newbie, it feels like looking for the needle in a haystack so any help is welcome.

routes.rb

Hooter::Application.routes.draw do

  resources :users
  resources :sessions, only: [:new, :create, :destroy]

  root to: 'static_pages#home'
  match '/help', to: 'static_pages#help'
  match '/about', to: 'static_pages#about'
  match '/contact', to: 'static_pages#contact'
  match '/signup', to: 'users#new'
  match '/signin', to: 'sessions#new'
  match '/signout', to: 'sessions#destroy', via: :delete

user_controller.rb

class UsersController < ApplicationController
  before_filter :signed_in_user, only: [:index, :edit, :update, :destroy]
  before_filter :correct_user, only: [:edit, :update]
  before_filter :admin_user, only: :destroy

  def new
    @user = User.new
  end

  def create
      @user = User.new(params[:user])
      if @user.save
        sign_in @user
        flash[:success] = "Welcome to the hooter App!"
        redirect_to @user
      else
        render 'new'
      end
  end

  def index
    @users = User.paginate(page: params[:page])
  end

  def show
    @user = User.find(params[:id])
  end

  def edit
  end

  def update
    @user = User.find(params[:id])

    if @user.update_attributes(params[:user])
      flash[:success] = "Profile updated"
      sign_in(@user)
      redirect_to @user
    else
      render 'edit'
    end
  end

  def destroy
    User.find(params[:id]).destroy
    flash[:success] = "User destroyed"
    redirect_to users_url
  end

  private

      def signed_in_user
        unless signed_in?
          store_location
          redirect_to signin_url, notice: "Please sign in."
        end
      end

      def correct_user
        @user = User.find(params[:id])
        redirect_to(root_path) unless current_user?(@user)
      end

      def admin_user
        redirect_to(root_path) unless current_user.admin?
      end
end

_header.html.erb

<header class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <%= link_to "hooter", root_path, id: "logo" %>
      <nav>
        <ul class="nav pull-right">
          <li><%= link_to "Home",    root_path %></li>
          <li><%= link_to "Help",    help_path %></li>
            <% if signed_in? %>
                <li><%= link_to "Users", users_path %></li>
                <li id="fat-menu" class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        Account <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><%= link_to "Profile", current_user %></li>
                        <li>
                            <%= link_to "Settings", edit_user_path(current_user) %>
                        </li>
                        <li class="divider"></li>
                        <li>
                        <%= link_to "Sign out", signout_path, method: "delete" %>
                        </li>
                    </ul>
                </li>
            <% else %>
                <li><%= link_to "Sign in", signin_path %></li>
            <% end %>
        </ul>
      </nav>
    </div>
  </div>
</header>

application.js

//= require jquery_ujs
//= require jquery
//= require bootstrap
//= require_tree .

application.html.erb

<!DOCTYPE html>
<html>
  <head>
    <title><%= full_title(yield(:title)) %></title>
    <%= stylesheet_link_tag    "application", media: "all" %>
    <%= javascript_include_tag "application" %>
    <%= csrf_meta_tags %>
    <%= render 'layouts/shim' %>    
  </head>
  <body>
    <%= render 'layouts/header' %>
    <div class="container">
          <% flash.each do |key, value| %>
            <div class="alert alert-<%= key %>"><%= value %></div>
          <% end %>
          <%= yield %>
          <%= render 'layouts/footer' %>
          <%= debug(params) if Rails.env.development? %>
        </div>
  </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:33:42+00:00Added an answer on June 14, 2026 at 9:33 am

    With help from the commenters and outsiders I managed to fix the problem.

    First of all I deleted the public/assets folder, which enable Heroku to do the compiling.

    Then I moved //= require bootstrap below my jquery import as such:

    //= require jquery
    //= require jquery_ujs
    //= require bootstrap
    //= require_tree .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im a newbie PHP programmer and I have a few questions about creating a
I'm a newbie programmer, and got a project in which I need to encrypt
All, I'm a relative newbie programmer and I want to install Xdebug to help
I'm kind of a newbie PHP programmer and never heard about PDO until a
I am still a newbie java programmer. I was learning about Java IO and
I'm a newbie programmer writting a program in MonoDevelop in C# and have a
I'm a newbie programmer trying to find my way in the world. I've got
I am a self-taught, newbie programmer, and I feel like this is a really
i am a newbie C# Programmer. I have a problem in xhtml. I want
I'm learning Java, and I know one of the big complaints about newbie programmers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.