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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:19:50+00:00 2026-06-11T13:19:50+00:00

So, I got an interesting problem. I am attempting to override and redirect a

  • 0

So, I got an interesting problem. I am attempting to override and redirect a devise sign_up and sign_in request to their appropriate profile pages but I am running into an error. The profiles and URL work by accessing it with console, link_to or by typing it out. For some reason the devise method won’t route to it. I’m not sure why. Anyways, upvotes for all that contribute or solve. Thanks!

Routes:

  root :to => 'pages#index'
  get "pages/index"

  devise_for :users, :path => 'accounts', :controllers => { :registrations => "registrations" }

  get 'users/:id/profile' => 'profiles#show', :as => 'current_profile'
  get 'users/:id/profile/edit' => 'profiles#edit', :as => 'edit_current_profile'
  put 'users/:id/profile' => 'profiles#update'

  resources :users do
    resources :profiles 
  end

Registration Controller:

class RegistrationsController < Devise::RegistrationsController

  protected

  def after_sign_up_path_for(resource)
     edit_current_profile_path(resource)
  end

  def after_sign_in_path_for(resource)
     current_profile_path(resource)
  end

end

Profile Controller

  def show
    @user = current_user
    @profile = @user.profile

    respond_to do |format|
      format.html 
    end
  end

Error message:

Routing Error

No route matches {:controller=>"profiles", :action=>"show"}
Try running rake routes for more information on available routes.

View: edit.html.erb

<%= form_for([@profile.user, @profile]) do |f| %>
  <% if @profile.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@profile.errors.count, "error") %> prohibited this profile from being saved:</h2>

      <ul>
      <% @profile.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :real_name %><br />
    <%= f.text_field :real_name %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
  • 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-11T13:19:51+00:00Added an answer on June 11, 2026 at 1:19 pm

    You should give an attribute to your route helpers. Try it out

    def after_sign_up_path_for(resource)
       edit_current_profile_path(resource)
    end
    
    def after_sign_in_path_for(resource)
       current_profile_path(resource) 
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into an interesting problem at work today. I got a request to
I got an interesting problem: file1.csv has a few hundred rows like: Code,DTime 1,2010-12-26
I've got an interesting box-model problem here. I have a header full of links,
I've stumbled upon an interesting problem while playing with my website. So I've got
I've got an interesting problem that's cropped up in a sort of pass based
I got an interesting time-travel problem today, using the following code: for (int i
I've got a real little interesting (at least to me) problem to solve (and,
I've got an interesting problem. I have an iPad App which has to parse
I'm having an interesting but difficult problem with my JavaScript code. Basically, I'm trying
I've got an interesting problem with JSON and Django. I think I've narrowed it

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.