README.rdoc in csv_rails-0.6.0 vs README.rdoc in csv_rails-0.6.1
- old
+ new
@@ -89,9 +89,20 @@
respond_to do |format|
format.csv{ render csv: @users, fields: [:ok, :"groups.first.name"], encoding: 'SJIS' } #=> "OK,グループ名"
end
end
+And you can use tsv. Both tsv and csv can accept row_sep option.
+
+ # app/controllers/user_controller.rb
+ def index
+ @users = User.all
+ respond_to do |format|
+ format.csv{ render csv: @users, :row_sep => "\r\n" }
+ format.tsv{ render tsv: @users, :row_sep => "\r\n" }
+ end
+ end
+
You also use i18n_scope option
# config/locales/ja.yml
ja:
csv:
name: なまえ