# Best Practice/Design: respond\_to in action with only one response type

**URL:** <https://www.ruby-forum.com/t/best-practice-design-respond-to-in-action-with-only-one-response-type/121349>\
**Category:** Rails\
**Created:** [November 27, 2007, 4:28am UTC](https://www.ruby-forum.com/t/best-practice-design-respond-to-in-action-with-only-one-response-type/121349 "2007-11-27T04:28:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [November 27, 2007, 4:28am UTC](https://www.ruby-forum.com/t/best-practice-design-respond-to-in-action-with-only-one-response-type/121349/1 "2007-11-27T04:28:46Z")

</div>

Question, if at first my controller is only going to be responding  
with html templates to requests is it best practice to keep the  
respond\_to block within each action?

respond\_to do |format|  
format.html  
end

I find it adds a lot of noise to a controller for nothing. Correct me  
if I am wrong though please.

Bonus question: why did we move from .rhtml to .html.erb? Are these  
the same for Rails or are they handled differently?

Thanks everyone.

–  
John K.  
removed\_email\_address@domain.invalid

Blog: [http://www.kopanas.com](http://www.kopanas.com)  
Conference: [http://www.cusec.net](http://www.cusec.net)  
Twits: [http://www.twitter.com/kopanas](http://www.twitter.com/kopanas)

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [November 27, 2007, 5:02am UTC](https://www.ruby-forum.com/t/best-practice-design-respond-to-in-action-with-only-one-response-type/121349/2 "2007-11-27T05:02:06Z")

</div>

I would say no.

To answer your bonus question…

I could do html.builder

Or js.erb

Or rss.erb

Or rss.builder.

Much nicer to separate the language from the content type.
