by on Rails can't convert ActiveSupport::HashWithIndifferentAccess into String
Ruby on Rails logo (Photo credit: Wikipedia) |
I had a errors can't convert ActiveSupport::HashWithIndifferentAccess into String. This errors because I wrong on determining params json.
For example:
1. I had params:
{:tabular => {"file"=>"data_tabular_Pemerintahan (Adm Pemerintahan, Aparatur Negara dan Adm Kepegawaian)_kecamatan Admin_2013.xls"}}
2. I call on my speadsheet:
def export
workbook = Spreadsheet.open(params[:tabular])
end
3. On above is not specified to parse parameter. So put this
def export
workbook = Spreadsheet.open(params[:tabular][:file])
end
I hope this article can help you,
Komentar
Posting Komentar
terimakasih komentarnya