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 9224635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:22:20+00:00 2026-06-18T04:22:20+00:00

I inherited an old Rails app and I’m really struggling with this error: ActionController::RoutingError

  • 0

I inherited an old Rails app and I’m really struggling with this error:

ActionController::RoutingError 
    (No route matches {:controller=>"users", :action=>"profile"}):
app/views/layouts/application.html.erb:59:in
    `_app_views_layouts_application_html_erb__105<snip>'
app/controllers/users_controller.rb:40:in `index'

I ONLY get this error when I log in as admin, not as any other user.

Here is my routes.rb

Vvault::Application.routes.draw do
  resources :orders

  devise_for :users

  resources :videos

  resources :users

  root :to => "users#index"

  match 'users/:id/profile' => 'users#profile', :as => :user_profile
end

I think this is the relevant snippet from users_controller.rb:

def index
  if current_user.admin?
    # admin sees all users
    @users = User.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @users }
    end
  else
    redirect_to "/users/" + current_user.id.to_s() and return
  end
end

I think this is the relevant snippet from application_html.erb:

<div class="sidebar">
    <% if user_signed_in? %>
      <%= link_to "My account", user_profile_path, :method => :get %>
    <% end %>
 </div>     

If i comment out the third line of application_html.erb I can login as admin, but obviously the profile link does not render for any user.

Any help appreciated.

Thanks!

  • 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-18T04:22:22+00:00Added an answer on June 18, 2026 at 4:22 am

    Try:

    <%= link_to "My account", user_profile_path(current_user.id), :method => :get %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just inherited an old WinForms app with a UI layout like this: I'm
I have inherited some really old VC6.0 code that I am upgrading to VS2008
I inherited this old TurboBasic code base, and I am converting it to something
The following query is something i inherited from an old app that adds 2
I recently inherited an old merb app that uses datamapper as its orm. I'm
I inherited an old app, written in C#/.NET 2.0. (un)Luckily there was no documentation
A friend of mine has inherited an old Joomla 1.0.x site, that amongst other
I work on an inherited project, old enough to use EJB 2.1 and JBoss
I inherited a bugzilla-like page that allows users to look at the bug list.
I inherited an Intraweb app that had a 2MB text file of memory leaks

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.