Monday, 3 November 2014

access helpers from controllers

def update_stats
render json: {
new_users: view_context.number_helper(User.created_today.count),
new_searches: view_context.number_helper(Query.searches_today)
}
end
view raw gistfile1.rb hosted with ❤ by GitHub

No comments:

Post a Comment