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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:09:31+00:00 2026-06-07T02:09:31+00:00

This error tells me – undefined method ‘user_profiles_path’, while my routes are like ‘user_profile_path’.

  • 0

This error tells me – undefined method ‘user_profiles_path’, while my routes are like ‘user_profile_path’. Profile is a singleton child resource of users. Not sure what is causing this error. The error is raised by <%= form_for [@user, @profile] do |f| %> in _form.html.erb.

Routes.rb:

devise_for :users, :path_names => { :sign_in => "login", :sign_up => "register" } do   
   get "/login", :to => "devise/sessions#new"
   get "/register", :to => "devise/registrations#new"
   get "/logout", :to => "devise/sessions#destroy"
   get '/account' => 'devise/registrations#edit'
 end

  root :to => "questions#redirect_on_visit" 

  match 'home', :to => "questions#index"

  resources :questions do
    resources :question_responses
  end

  resources :users do
    resource :profile
  end

_form.html.erb:

<%= form_for [@user, @profile] do |f| %>

 <%= f.error_messages %>    

 <div class="field">
    <%= f.label :display_name, "Display Name" %><br />
    <%= f.text_field :display_name, :size => "43" %><br />
 </div>

 <div class="field">
    <%= f.label :current_location, "Current Location" %><br />
    <%= f.text_field :current_location, :size => "43" %><br />
 </div>

 <div><%= f.label :nationality, "Nationality" %><br />
    <%= f.collection_select :nationality, Profile::NATIONALITY, :include_blank => true %>
 </div><br />

 <div><%= f.label :home_place, "Home Place" %><br />
    <%= f.collection_select :home_place, Profile::HOME_PLACE, :include_blank => true %>
 </div><br />

  <div><%= f.label :occupation, "Occupation" %><br />
    <%= f.collection_select :occupation, Profile::OCCUPATION, :include_blank => true %>
  </div><br />

  <div><%= f.label :interest, "Interests" %><br />
    <%= f.collection_select :interest, Profile::INTERESTS, :include_blank => true %>
  </div><br />

  <div><%= f.label :hobby, "Hobbies" %><br />
    <%= f.collection_select :hobby, Profile::HOBBIES, :include_blank => true %>
  </div><br />

  <div class="field">
    <%= f.label :bio, "Short Bio" %><br />
    <%= f.text_area :bio, :size => "50x5" %>
  </div>

  <div class="submit">
    <%= f.submit "Create Profile" %>
  </div>

<% end %>

profiles_controller.rb:

class ProfilesController < ApplicationController

  before_filter :find_user

  def new
    @profile = @user.build_profile    
  end

  def edit

  end

  private

  def find_user
    @user = User.find(params[:user_id])
  end
end

application.html.erb:

<% if user_signed_in? %>
            <% if !current_user.try(:profile) %>
                Signed in as<div><%= link_to current_user.email, new_user_profile_path(current_user.id) %></div><br /><br />
            <% else %>
                Signed in as<div><%= link_to current_user.email, edit_user_profile_path(current_user.id) %></div><br /><br />
            <% end %>           
            Not you? <%= link_to "Sign out", logout_path %>
        <% else %>
            <%= link_to "Sign up", new_user_registration_path %> or <%= link_to "Sign in", new_user_session_path %>
        <% end %>

Routes:

user_profile POST   /users/:user_id/profile(.:format)                             profiles#create
               new_user_profile GET    /users/:user_id/profile/new(.:format)                         profiles#new
              edit_user_profile GET    /users/:user_id/profile/edit(.:format)                        profiles#edit
                                GET    /users/:user_id/profile(.:format)                             profiles#show
                                PUT    /users/:user_id/profile(.:format)                             profiles#update
                                DELETE /users/:user_id/profile(.:format)           
  • 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-07T02:09:32+00:00Added an answer on June 7, 2026 at 2:09 am

    Okay this error is a known bug as reported here: https://github.com/rails/rails/issues/1769

    And I found the right way to specify URL.

    form_for([@user, @profile], url: user_profile_path(@user))

    Syntactically important to have braces and important that there is no space between form_for and parenthesis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Error tells me that No '-setRosterForBoat:' method found. What I am doing is attempting
The error is : Fatal error: Call to undefined method wSpider::fetchPage() Firstly, what I'm
Can anyone please tell why this error? I have included everything ( all header,
This is the error occurs in logcat,can anyone tell what's the meaning? private int
hi can anybody tell me the error in this? #include<stdio.h> int main() { char
Can anyone tell me why this would generate a syntax error in Safari and
Can someone tell me why this http://hupcapstudios.com/projects/calendar.html won't load in IE? The error message:
Can anyone tell me what's wrong with this code? It's giving me an error
This error come in log. from='kutbi1@360degree/Smack' to='akash@360degree/Smack' type='error' id='hK1L6-5'> <si xmlns='http://jabber.org/protocol/si' id='jsi_191216212994140179' mime-type='image/png' profile='http://jabber.org/protocol/si/profile/file-transfer'>
this error is always fired, when i'm try to free my allocated struct the

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.