I'm trying to develop some conventions behind our controller responses. One of my conventions is:
On successful
create
, if the request is XHR, render @the_object
I can't see anything that allows me to do this across the board. Currently I'm doing this:
def create
create! do |success, failure|
success.html {
render @the_object if request.xhr?
}
end
end
It's obviously not ideal to have to do this for each controller. Does anyone know if I can create site-wide configurable responses?