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