Sha256: f6f36746df022ce180ef865f85b8b74d9873cb30761795be81b01f5f74b230d7
Contents?: true
Size: 488 Bytes
Versions: 4
Compression:
Stored size: 488 Bytes
Contents
class UsersController < ApplicationController def index @users = User.includes(:groups) respond_to do |format| format.html format.csv { render csv: @users, fields: [:id, :name, :age, :"groups.first.name"], without_header: true } end end def sjis @users = User.includes(:groups).all respond_to do |format| format.html format.csv { render csv: @users, fields: [:id, :name, :age, :"groups.first.name"], encoding: 'SJIS' } end end end
Version data entries
4 entries across 4 versions & 1 rubygems