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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:20:35+00:00 2026-05-16T01:20:35+00:00

With actions such as :show and :edit , I can just http GET them.

  • 0

With actions such as :show and :edit, I can just http GET them. But since the :update action has no template, I can’t issue a GET without it complaining about the missing template. That makes sense, so I tried to directly call @controller.update in my test, but I get an error on the respond_to block:

NoMethodError: undefined method `parameters' for nil:NilClass

How do I specify the requested format to be :html? I am passing in a parameter hash for the model’s attributes, FWIW. Thanks for any advice.

Edit:
I since tried invoking @controller.update (after setting params[]) in the console and that error quoted above bubbled up from here: /actionpack-2.3.8/lib/action_controller/mime_responds.rb

I also tried PUT instead of GET, but still got “Missing Template update.erb”.

Also, I managed to find out that this error of missing template is caused by having anything other than a redirect or render in the code block marked HERE:

respond_to do |format|
  if @model.update_attributes(params[:model])
     flash[:notice] = 'note!'
     format.html { **HERE** }
     ...

I have a method call there that is just a conditional to redirect to the proper place. I can, in principle, understand why it might look for a template to render since it may not be aware that there is a redirect further downstream, but what I don’t understand is how come my web application doesn’t run into the same error as my functional test.

  • 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-16T01:20:36+00:00Added an answer on May 16, 2026 at 1:20 am
    • You should be calling put :update in your test. If you have code like @my_model.update_attributes(params[:my_model]) in the controller then you would call put :update, :id => <whatever>, :my_model => {:foo => 'bar'} in your test.
    • :html is the default format, so you don’t need to specify it. If you really wanted to, you could do put :update, :format => :html. But again, not necessary.
    • As Emily said, it’s params, not parameters, so you might be accessing the wrong hash

    Overall this question could use some more detail about what you’re trying to do and what your current code looks like.

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

Sidebar

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.