Answer the question
In order to leave comments, you need to log in
How to determine encoding in Ruby on Rails when generating xls file?
I link like this:
<%= link_to 'Скачать excel', exportsub_path(format: "xls") %>
def export
@subscribers = Subscriber.where(user_id: session[:user_id])
respond_to do |format|
format.html
format.xls
end
end
Answer the question
In order to leave comments, you need to log in
В контроллере добавить
before_filter :set_charset
def set_charset
response.headers["Content-Type"] = "text/html; charset=utf-8"
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question