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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:21:03+00:00 2026-05-23T11:21:03+00:00

Relatively new to Ruby on Rails but I think I have the basics down.

  • 0

Relatively new to Ruby on Rails but I think I have the basics down. I’m running into one problem though that i just can’t figure out and don’t really know how to debug.

I have shallow routes:

resources :incident_reports, :shallow => true do
    get :thanks, :on => :collection
    get :monthly_totals, :on => :collection
    post :monthly_totals_download, :on => :collection
    resources :supervisory_reviews, :comments
  end

And rake routes shows what i expect:

incident_report_supervisory_reviews GET    /incident_reports/:incident_report_id/supervisory_reviews(.:format)     {:action=>"index", :controller=>"supervisory_reviews"}
                                         POST   /incident_reports/:incident_report_id/supervisory_reviews(.:format)     {:action=>"create", :controller=>"supervisory_reviews"}
  new_incident_report_supervisory_review GET    /incident_reports/:incident_report_id/supervisory_reviews/new(.:format) {:action=>"new", :controller=>"supervisory_reviews"}
                 edit_supervisory_review GET    /supervisory_reviews/:id/edit(.:format)                                 {:action=>"edit", :controller=>"supervisory_reviews"}
                      supervisory_review GET    /supervisory_reviews/:id(.:format)                                      {:action=>"show", :controller=>"supervisory_reviews"}
                                         PUT    /supervisory_reviews/:id(.:format)                                      {:action=>"update", :controller=>"supervisory_reviews"}
                                         DELETE /supervisory_reviews/:id(.:format)                                      {:action=>"destroy", :controller=>"supervisory_reviews"}
                incident_report_comments GET    /incident_reports/:incident_report_id/comments(.:format)                {:action=>"index", :controller=>"comments"}
                                         POST   /incident_reports/:incident_report_id/comments(.:format)                {:action=>"create", :controller=>"comments"}
             new_incident_report_comment GET    /incident_reports/:incident_report_id/comments/new(.:format)            {:action=>"new", :controller=>"comments"}
                            edit_comment GET    /comments/:id/edit(.:format)                                            {:action=>"edit", :controller=>"comments"}
                                 comment GET    /comments/:id(.:format)                                                 {:action=>"show", :controller=>"comments"}
                                         PUT    /comments/:id(.:format)                                                 {:action=>"update", :controller=>"comments"}
                                         DELETE /comments/:id(.:format)                                                 {:action=>"destroy", :controller=>"comments"}

i have show and update and everything else defined in supervisory_reviews_controller

def update
    @supervisory_review = SupervisoryReview.find(params[:id])

    respond_to do |format|
      if @supervisory_review.update_attributes(params[:supervisory_review])
        format.html { redirect_to(@supervisory_review.incident_report, :notice => 'Supervisory review was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { redirect_to(@supervisory_review.incident_report, :notice => 'An error occurred.') }
        format.xml  { render :xml => @supervisory_review.errors, :status => :unprocessable_entity }
      end
    end
  end

but when i try to show, update or delete a supervisory review
(form example)

<form accept-charset="UTF-8" action="/supervisory_reviews/1047" class="edit_supervisory_review" id="edit_supervisory_review_1047" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /><input name="authenticity_token" type="hidden" value="ii8Xhygfcr71icNZfljlEkQItpV1+zFKaEn6ZZdYjiE=" />

(looks right, right?)

i get “The page you were looking for doesn’t exist”

and the log says:

Started POST
“/supervisory_reviews/1047” for
10.1.5.24 at Fri Jun 24 17:14:21 -0 400 2011 Processing by
SupervisoryReviewsController#update as
HTML Parameters:
{“authenticity_token”=>”ii8Xhygfcr71icNZfljlEkQItpV1+zFKaEn6ZZdYji
E=”, “utf8″=>”âo””, “id”=>”1047”,
“supervisory_review”=>{“inappropriate_reason”=

“”, “advocacy_next_steps”=>””, “resolution”=>””,
“comments”=>”gfhsdfgsdfg”, “ha
ndling_of_incident”=>””,
“recommendations”=>”dfsgdfggdfsd”,
“need_for_advocacy”=
“false”, “incident_resolved”=>”true”, “incident_handled_appropriately”=>”true”}
} Completed in 2ms

ActiveRecord::RecordNotFound (Couldn’t
find IncidentReport without an ID):
lib/role_requirement_system.rb:121:in
check_roles'
lib/role_requirement_system.rb:121:in
check_roles’

so why is it looking for an IncidentReport?

the weirdest part is Comments work fine and as far as i can tell, the code for both resources is the same.

  • 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-23T11:21:04+00:00Added an answer on May 23, 2026 at 11:21 am

    The issue is not with the routes but with the lib/role_requirement_system.rb line 121. Perhaps that code needs an IncidentReport to provide authorization. Post the code from that library if you need more help.

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

Sidebar

Related Questions

I'm relatively new to Ruby on Rails. As of now have this working code
I am very new to ruby / rails and have an issue that I
I'm relatively new to ruby and i came from php. One thing that it
I'm relatively new to Ruby on Rails 3 and hope to integrate Ambethia's Recaptcha
I am relatively new to ruby on rails, so this question might be easy.
I am relatively new to Ruby, but I am trying to catch a variable
I am relatively new to rails and have been working my way through the
I'm relatively new to Ruby on Rails and occasionally I find this convention-over-configuration stuff
I'm relatively new to Ruby and have limited time therefore I try out simple
I'm still relatively new to Rails and Ruby - and after upgrading to 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.