time_ago_in_words is a method from the helpers of active_view. Those
methods are not directly exposed in your controller.
You should resist the temptation to format a response in the
controller. Pass objects to the view and let them take care of the
format. This separation of model-view-controller will make testing
easier and keep everything simple
You should resist the temptation to format a response in the
controller. Pass objects to the view and let them take care of the
format. This separation of model-view-controller will make testing
easier and keep everything simple
Hi Zack,
Thanks for the response.
I’m formatting this data in response to an Ajax request, and want to
update the page with the formatted data, but without a refresh.
If this is possible, can you point me in the direction of how I would do
this by passing an object to the view and formatting it there?