rweng / jquery-datatables-rails

jquery-datatables gem for rails
MIT License
564 stars 338 forks source link

Cannot set sSwfPath to have it to work #40

Closed phron closed 11 years ago

phron commented 11 years ago

Hello I'm developping an app on local. I try to add TableTools to my dataTables. The TableTools buttons are well displayed on the page but they have no effect, I always have a routing error about swfPath.

What is the correct way to have TableTools working on local ? Thanks for help

application.js

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap
//= require dataTables/extras/TableTools
//= require dataTables/extras/ZeroClipboard
//= require_tree .

users.js.coffee

jQuery ->

  #  Init the table
  $('#users-grid').dataTable
    bjQueryUI: true
    sDom: 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>'
    oTableTools:
      sSwfPath: "swf/copy_csv_xls_pdf.swf"
    sPaginationType: "bootstrap"
    bProcessing: true
    bServerSide: true
    sAjaxSource: $('#users-grid').data('source')

server log

Started GET "/backstage/swf/copy_csv_xls_pdf.swf" for 127.0.0.1 at 2013-02-26 11:48:11 +0100

ActionController::RoutingError (No route matches [GET]   "/backstage/swf/copy_csv_xls_pdf.swf"):
  actionpack (3.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.1) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.1) lib/rails/rack/logger.rb:16:in `call'
  quiet_assets (1.0.1) lib/quiet_assets.rb:20:in `call_with_quiet_assets'
  actionpack (3.2.1) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
 activesupport (3.2.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
 rack (1.4.5) lib/rack/lock.rb:15:in `call'
 actionpack (3.2.1) lib/action_dispatch/middleware/static.rb:53:in `call'
 railties (3.2.1) lib/rails/engine.rb:479:in `call'
 railties (3.2.1) lib/rails/application.rb:220:in `call'
 rack (1.4.5) lib/rack/content_length.rb:14:in `call'
 railties (3.2.1) lib/rails/rack/log_tailer.rb:14:in `call'
 rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
 C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

  Rendered C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.0ms)

I tried different things with no results (copying the 'media" directory in my app/assets directory, or the swf directory in my assets/backstage/' directory etc...) no luck

Any help would be very appreciated

ricardodovalle commented 11 years ago

@anso, did you solve the problem? May I close the thread?

phron commented 11 years ago

@ricardodovalle

Yes I did, long time ago ^_^. You can close the thread

rodrigoarino commented 10 years ago

here comment a solution http://stackoverflow.com/questions/15087450/rails-datatables-cannot-set-sswfpath not work for me