Altro errore: can't dup Symbol

Eccomi di nuovo qui…

sembra che tutto giri quando mi inchiodo con un “can’t dup symbols”…
ho cercato su google l’errore ma c’è una sola segnalazione e non sembra
fare al caso mio.

Disastro…

Se qualcuno mi dà una mano…grazie in anticipo

#controller

def download
send_file(params[:path_to_file], :disposition => :attachment)
end

#view

<% @atts.each do |att| %>
<% uscore = “_”
pathFile = “#{Attachment::EXTENDEDPATH
}#{att.idext.to_s}#{uscore}#{att.categoria}#{uscore}#{att.nome}#{uscore}#{att.nomeoriginale}”%>

  • <%=h att.didascalia %>, <%=h att.nomeoriginale%>    <% form_tag :controller => 'attachments', :action => 'download' do %> <%= hidden_field_tag 'path_to_file', pathFile %> <%=submit_tag 'SCARICA', :id => "search-submit-attach" %> <% end %> <%= link_to image_tag("delete.gif", :border=>0), att, :confirm => 'Sicuri ?', :method => :delete %>
  • <% end %>

    errore

    TypeError in AttachmentsController#download

    can’t dup Symbol

    RAILS_ROOT: F:/rubyProjects/fg
    Application Trace | Framework Trace | Full Trace

    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:154:in
    dup' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:154:insend_file_headers!’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:84:in
    send_file' F:/rubyProjects/fg/app/controllers/attachments_controller.rb:37:indownload’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in
    perform_action' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:617:incall_filters’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in
    perform_action_with_filters' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inblock in perform_action_with_benchmark’
    F:/rubyProjects/fg/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in
    block in ms' C:/Ruby191/lib/ruby/1.9.1/benchmark.rb:309:inrealtime’
    F:/rubyProjects/fg/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in
    ms' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_with_benchmark’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in
    perform_action_with_rescue' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/flash.rb:151:inperform_action_with_flash’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:532:in
    process' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:606:inprocess_with_filters’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:391:in
    process' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:386:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in
    `call’

    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:154:in
    dup' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:154:insend_file_headers!’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:84:in
    send_file' F:/rubyProjects/fg/app/controllers/attachments_controller.rb:37:indownload’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in
    perform_action' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:617:incall_filters’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in
    perform_action_with_filters' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inblock in perform_action_with_benchmark’
    F:/rubyProjects/fg/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in
    block in ms' C:/Ruby191/lib/ruby/1.9.1/benchmark.rb:309:inrealtime’
    F:/rubyProjects/fg/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in
    ms' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_with_benchmark’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in
    perform_action_with_rescue' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/flash.rb:151:inperform_action_with_flash’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:532:in
    process' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:606:inprocess_with_filters’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:391:in
    process' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:386:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in
    call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:indispatch’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in
    _call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:inblock in build_middleware_stack’
    F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in
    call' F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:inblock in call’
    F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
    cache' F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:incache’
    F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in
    call' F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in
    call' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/head.rb:9:incall’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in
    call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in
    call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:incall’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lock.rb:11:in
    block in call' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lock.rb:11:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:114:in
    block in call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/reloader.rb:34:inrun’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:108:in
    call' F:/rubyProjects/fg/vendor/rails/railties/lib/rails/rack/static.rb:31:incall’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/urlmap.rb:47:in
    block in call' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/urlmap.rb:41:ineach’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in
    call' F:/rubyProjects/fg/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:incall’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/content_length.rb:13:in
    call' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:inservice’
    C:/Ruby191/lib/ruby/1.9.1/webrick/httpserver.rb:111:in service' C:/Ruby191/lib/ruby/1.9.1/webrick/httpserver.rb:70:inrun’
    C:/Ruby191/lib/ruby/1.9.1/webrick/server.rb:183:in `block in
    start_thread’

    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:154:in
    dup' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:154:insend_file_headers!’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/streaming.rb:84:in
    send_file' F:/rubyProjects/fg/app/controllers/attachments_controller.rb:37:indownload’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in
    perform_action' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:617:incall_filters’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in
    perform_action_with_filters' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inblock in perform_action_with_benchmark’
    F:/rubyProjects/fg/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in
    block in ms' C:/Ruby191/lib/ruby/1.9.1/benchmark.rb:309:inrealtime’
    F:/rubyProjects/fg/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in
    ms' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_with_benchmark’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in
    perform_action_with_rescue' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/flash.rb:151:inperform_action_with_flash’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:532:in
    process' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/filters.rb:606:inprocess_with_filters’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:391:in
    process' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/base.rb:386:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:438:in
    call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:indispatch’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in
    _call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:inblock in build_middleware_stack’
    F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in
    call' F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:inblock in call’
    F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
    cache' F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:incache’
    F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in
    call' F:/rubyProjects/fg/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in
    call' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/head.rb:9:incall’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in
    call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:incall’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in
    call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:incall’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lock.rb:11:in
    block in call' <internal:prelude>:8:insynchronize’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/lock.rb:11:in
    call' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:114:inblock in call’
    F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/reloader.rb:34:in
    run' F:/rubyProjects/fg/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:108:incall’
    F:/rubyProjects/fg/vendor/rails/railties/lib/rails/rack/static.rb:31:in
    call' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/urlmap.rb:47:inblock in call’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in
    each' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/urlmap.rb:41:incall’
    F:/rubyProjects/fg/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in
    call' C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/content_length.rb:13:incall’
    C:/Ruby191/lib/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in
    service' C:/Ruby191/lib/ruby/1.9.1/webrick/httpserver.rb:111:inservice’
    C:/Ruby191/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' C:/Ruby191/lib/ruby/1.9.1/webrick/server.rb:183:inblock in
    start_thread’

    Request

    Parameters:

    {“authenticity_token”=>“yWBu7XdV55PJDz6gNV5WEj90bCbOFvrNMAf034gMLNw=”,
    “path_to_file”=>“F:/rubyProjects/fg/public/uploads/5_1_1281281804_filmDaScaricare.txt”,
    “commit”=>“SCARICA”}

    Ma quella è la view del metodo download o di un altro metodo?

    penso che :disposition voglia una string e non un symbol prova…

    Hai ragione, ho messo string e funzionaaaaaaaaa!

    Grazie !

    come faccio ora a togliere l’avviso “Le impostazioni correnti non
    consentono il downoad” ?

    :°(

    Alessandro S. wrote:

    Ma quella è la view del metodo download o di un altro metodo?

    penso che :disposition voglia una string e non un symbol prova…

    An Car wrote:

    Hai ragione, ho messo string e funzionaaaaaaaaa!

    Grazie !

    come faccio ora a togliere l’avviso “Le impostazioni correnti non
    consentono il downoad” ?

    :°(

    penso sia un messaggio del tuo browser… cambia le impostazioni…