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

  • Home
  • SEARCH
  • 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 8935733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:03:40+00:00 2026-06-15T10:03:40+00:00

I get the below error when running the below code on a controller. Please

  • 0

I get the below error when running the below code on a controller. Please note the :formats=>[:json] in the error, even though :formats=>[:html] is passed into render_to_string

What am I doing wrong? Any ideas?
Actually, the code below worked fine before, not sure what changes influenced this error.
Rails version: 3.2.8

btw the template is definitely in place: loc/_search_details.html.erb

Bonus question: where can I find the api documentation showing what parameters can be passed to render_to_string and how it works?

Error:
ActionView::MissingTemplate (Missing partial loc/search_details with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder, :coffee]}.

  respond_to do |format|
    format.json { 
      @detail_str = render_to_string(:partial => 'loc/search_details', :layout => false, :formats=>[:html], :locals => {:beer_results => @beer_results})
      @list_str = render_to_string(:partial => 'loc/search_list', :layout => false,:formats=>[:html], :locals => {:beer_results => @beer_results})
      render :json => {:results => @results_hash, :result_details => @detail_str, :result_list => @list_str }

      }
  end
  • 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-15T10:03:41+00:00Added an answer on June 15, 2026 at 10:03 am

    See this question and this issue. Since you’re making a JSON request your render_to_string is expecting your partial to be _search_details.json.erb. You can either provide an additional JSON partial, rename the partial or add this to the partial <% self.formats = [:json, :html] %>, or alternatively, try the workaround in the accepted answer to that question.

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

Sidebar

Related Questions

I get the following error when running the code below: invalid byte sequence in
I get this message when running the code below: There is an error in
I get this error when running the code below: Dim sqlSCIQty As String Dim
On VS C# Express, I get this error when running the code below: 'myComponent.SettingsComponentAttributes'
I will get the error below randomly when I'm running an asp.net application I
I get this error when I run the code below. I have normally used
I get the following error with the code below. expected constructor, destructor, or type
I get the below error when running a custom command from the yiic shell.
Running the code below gives me the error -bash: [: -ne: unary operator expected
I get an error when running my code. The culprit is me accessing a

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.