vrp1609
vrp1609

Reputation: 61

Missing template error even though template exists

I am watching the logs and this is what i see

Processing by TestController#get_branches_for_repo as */*

ActionView::MissingTemplate (Missing template test/get_branches_for_repo, application/get_branches_for_repo with {:handlers=>[:erb, :builder], :formats=>[:html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json], :locale=>[:en, :en]}. Searched in:* "/export/web/metrics-vviswanathan/app/views"):

I have a view

_get_branches_for_repo.erb

in app/views/test/

What does it mean when it is processing as */* ?

Oh, and my controller function looks like this

def get_branches_for_repo
   blah

   render :partial => "get_branches_for_repo"
end

Please help

Upvotes: 0

Views: 1119

Answers (2)

mb2nd
mb2nd

Reputation: 111

Are you using a particular layout when rendering the partial? I usually use partials in my views as they need to be part of some template and I don't believe they can be rendered on there own. Can you get the same effect your looking for by changing your view file from _get_branches_for_repo.erb to get_branches_for_repo.erb(no underscore) and taking out the render statement all together in your controller. That way you will be using a template and not a partial. If you provide a little more info I maybe able to help further. I hope this helps. Here's a guide to rendering that has helped me tremendously http://guides.rubyonrails.org/layouts_and_rendering.html

Upvotes: 0

jdoe
jdoe

Reputation: 15771

Why your _get_branches_for_repo.erb file name doesn't have .html in the middle? Add it, resave the file just in case and try again.

About */*. I know that IE after a page refresh does this. It's not Rails thing. You don't have to be worried about it.

Upvotes: 1

Related Questions