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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:46:41+00:00 2026-06-08T17:46:41+00:00

I’m beginner at Rails, and im actually stuck with apparently a beginner problem. I

  • 0

I’m beginner at Rails, and im actually stuck with apparently a “beginner problem”.

I got a “sounds” scaffolded controller, and i had to add an action “sendit”. I can’t have access to the sound from my view to my controller.

This is my error when i try to access to “http://127.0.0.1:3000/sounds/sendit.14” (Why it’s sendit.14 and not sounds/sendit/14 or sounds/14/sendit ?)

ActiveRecord::RecordNotFound in SoundsController#sendit

Couldn't find Sound without an ID

Application Trace | Framework Trace | Full Trace
app/controllers/sounds_controller.rb:74:in `sendit'
Request

Parameters:

{"format"=>"14"}

Here is my code :

Sound Controller :

def sendit
    @sound = Sound.find(params[:id]) # ----- Error is on this line -----
    # Do Job
  end

Index.html.erb

<% @sounds.each do |sound| %>
  <% if sound.user_id == current_user.id %>
    <tr>
      <td><%= sound.title %></td>
      <td><%= sound.user.email %></td>
      <td><%= link_to 'Show', sound %></td>
      <td><%= link_to 'Edit', edit_sound_path(sound) %></td>
      <td><%= link_to 'Destroy', sound, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      <td><%= link_to 'Send', sounds_sendit_path(sound) %></td>

routes.rb

  devise_for :users

  match "/sounds/sendit/", :controller => "sounds", :action => "sendit"

  resources :users, :sounds

I did this in the route file because of Adding an action to an existing controller (Ruby on Rails)

When i do rake routes , this is the output :

              [...]
           sounds_sendit        /sounds/sendit(.:format)       sounds#sendit 
                   users GET    /users(.:format)               users#index
                         POST   /users(.:format)               users#create
                new_user GET    /users/new(.:format)           users#new
               edit_user GET    /users/:id/edit(.:format)      users#edit
                    user GET    /users/:id(.:format)           users#show
                         PUT    /users/:id(.:format)           users#update
                         DELETE /users/:id(.:format)           users#destroy
                  sounds GET    /sounds(.:format)              sounds#index
                         POST   /sounds(.:format)              sounds#create
               new_sound GET    /sounds/new(.:format)          sounds#new
              edit_sound GET    /sounds/:id/edit(.:format)     sounds#edit
                   sound GET    /sounds/:id(.:format)          sounds#show
                         PUT    /sounds/:id(.:format)          sounds#update
                         DELETE /sounds/:id(.:format)          sounds#destroy
                    root        /                              home#index

(I actually don’t understand the first line, why there is no POST / GET, and why it’s sounds_sendit and no sendit_sound like others default actions? How to fix it? )

Thank you for your help

  • 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-08T17:46:42+00:00Added an answer on June 8, 2026 at 5:46 pm

    Instead of this :

    match "/sounds/sendit/", :controller => "sounds", :action => "sendit"
    

    Use this:

      resources :sounds do
        member do
          get :sendit
        end
      end
    

    Then you will be able to use the sendit_sound_path helper to link to the action correctly:

    link_to "link text", sendit_sound_path(sound_object)
    

    Hope this does it for you,…

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
i got an object with contents of html markup in it, for example: string
I am currently running into a problem where an element is coming back from
I'm parsing an XML file, the creators of it stuck in a bunch social
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.