In my application i need to set some deafult actions for all format.js and format.htm responses. At this moment I have something like this in all controllers:
def index
@users = User.all
respond_to do |format|
format.html {html_response}
format.js {js_response}
end
end
But I think that it isn’t a good solution. What can I do?
Make a private method in your
ApplicationControllerand call it from wherever required