On 2006-03-16, at 17:10 , David Heinemeier Hansson wrote:

Even more, we could have a reasonable default type preference order,
so that calling respond_to is not needed at all, for these simple
cases where there's no custom code needed for each type.

Please expand on this. How would this look? Often times you don't have
an js option for something, so if we just expect you to an error would
occur. Instead of now, where we just do a 406.

Basically, we decide upon a default type order and intersect that with the available view files. Let's say the default response order is :html, :xml, :js

If we have an action foo with the view files foo.rhtml and foo.rjs, we'll get this:

  respond_to(:html, :js)

Notice that xml is out, because we don't have a view file for it. Following this reasoning, for action bar which only has the standard bar.rhtml file, things will work exactly as they do now. (as if you had only respond_to(:html))

Makes sense?
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to