by on Rails can't convert ActiveSupport::HashWithIndifferentAccess into String

Ruby on Rails logo
Ruby on Rails logo (Photo credit: Wikipedia)
Hi Everyone,

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,
Enhanced by Zemanta

Komentar

Postingan populer dari blog ini

EPrT English Proficiency Test Soal - soal

cara memunculkan dan menyembunyikan icon date, time, clock, volume, network, power battery, action center pada taskbar pada Windows 7

Cara Mengurus Perpanjang SIM dan Rincian Biaya di Lumajang.