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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:06:10+00:00 2026-05-26T07:06:10+00:00

This is my route: scope :username do resources :feedbacks end When I do rake

  • 0

This is my route:

scope ":username" do
  resources :feedbacks
end

When I do rake routes, I get this:

    feedbacks GET    /:username/feedbacks(.:format)          {:action=>"index", :controller=>"feedbacks"}
              POST   /:username/feedbacks(.:format)          {:action=>"create", :controller=>"feedbacks"}
 new_feedback GET    /:username/feedbacks/new(.:format)      {:action=>"new", :controller=>"feedbacks"}
edit_feedback GET    /:username/feedbacks/:id/edit(.:format) {:action=>"edit", :controller=>"feedbacks"}
     feedback GET    /:username/feedbacks/:id(.:format)      {:action=>"show", :controller=>"feedbacks"}
              PUT    /:username/feedbacks/:id(.:format)      {:action=>"update", :controller=>"feedbacks"}
              DELETE /:username/feedbacks/:id(.:format)      {:action=>"destroy", :controller=>"feedbacks"}

But when I do feedbacks_url or feedbacks_path I get an routing error like this:

No route matches {:controller=>"feedbacks", :format=>nil}

From the log file:

Rendered users/show.html.erb within layouts/application (18.3ms)
Completed 500 Internal Server Error in 142ms

ActionView::Template::Error (No route matches {:controller=>"feedbacks", :format=>nil}):
    1: <%= form_for(@feedback) do |f| %>
    2:   <% if @feedback.errors.any? %>
    3:     <div id="error_explanation">
    4:       <h2><%= pluralize(@feedback.errors.count, "error") %> prohibited this feedback from being saved:</h2>
  app/views/feedbacks/_form.html.erb:1:in `_app_views_feedbacks__form_html_erb__2195884682603870163_2484875900'
  app/views/users/show.html.erb:11:in `_app_views_users_show_html_erb__3889159515317937411_2159438040'
  app/controllers/vanities_controller.rb:14:in `show'

This is the form partial feedbacks/_form.html.erb:

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

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

  <% if current_user %>

       <div class="poster_id">
        <%= f.hidden_field "poster_id", :value => current_user.id %><br />
       </div>
       <div class="receiver_id">
         <%= f.hidden_field "receiver_id", :value => @user.id %><br />
       </div>
       <div class="field">
         <%= f.text_field :content %>
       </div>
       <div class="actions">
         <%= f.submit %>
       </div>

   <% end %>


<% end %>

Thoughts?

  • 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-05-26T07:06:11+00:00Added an answer on May 26, 2026 at 7:06 am

    Well,

    scope ":username" do
    

    means that your routes need some info about :username to work properly.

    You should then add this info in all your links:

    user_path(user, :username => "joe")
    edit_user_path(user, :username => "joe")
    ...
    

    Or you could tell your app the username isn’t mandatory which seems logic if user isn’t created yet. So change your route to:

    scope "(:username)" do
      resources :feedbacks
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my route: scope :username do resources :feedbacks end So when I go
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
I have this in my routes.rb scope '/admin' do root :to => 'home#index' resources
I need help with this route map routes.MapRoute(Blog_Archive, Blog/Archive/{year}/{month}/{day}, new { controller = Blog,
I am using a route like this one: routes.MapRoute(Invoice-New-NewCustomer, Invoice/New/Customer/New/{*name}, new { controller =
For this route: resources :projects do member do resources :stakeholders end end The generated
Trying to route: scope :shortcut do resources :text_elems end Using basic scaffold with form
I've started this question Named route with nested resources , and it lead me
Can anyone explain why this code with the given routes returns the first route?
I have the following routes defined: resources :patients do collection do get 'import' =>

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.