Reputation: 42049
I've got a home_controller.rb that has different methods whose purpose is to just render render partials that have different content.
I have the urls created in the config
get '/interview', :to => 'home#interview'
get '/chambers', :to => 'home#chambers'
get '/letter', :to => 'home#letter'
get '/drafting', :to => 'home#letter'
and the methods set up that render partials (I was experimenting with symbols vs single quotes) from the home_controller.rb
def chambers
render 'home/chambers'
end
def drafting
render 'drafting'
end
def interview
render :interview
end
However, I'm getting a missing template error (Template is Missing) message when I click the links.
I can get it to work without using partials but rather regular files interview.html.erb (for example) but I would still like to know why it's not working with partials.
Thanks
Upvotes: 0
Views: 79
Reputation: 1439
you need to specify it as partial if you want to render a partial else rails will look for file or an action with that name.
render :partial => 'drafting'
Code for rendering logic in rails https://github.com/rails/rails/blob/5215eed5a3f18c76d70f0f25bca4ff6286c4bac8/actionpack/lib/abstract_controller/rendering.rb#L141
Upvotes: 1