Problems with Datatable Production environment - Linux / Apache

Problems with Datatable Production environment - Linux / Apache

fammunhozfammunhoz Posts: 1Questions: 0Answers: 0
edited February 2013 in General
Good morning

Somedays I'm trying to run a rails application with datatable on the production environment.
The server is a debian with rvm, ruby 1.9.3, rails 3.2.6 and apache installed.
The main application runs fine but the component referring to the datatable is totally ignored.

It does not show the datatables and in the source code of the page you can verify that it is not loading any files: "* js.coffee" which belongs to the folder "assets".

The awkward thing regards to a different component connected to javascript / jquery that works properly in the same application.
Only the datatable component that is not loading.

Is the datatable component compatible with Apache, ruby 1.9.3 and rails 3.2.6?

Or

In the production environment (linux) need a different configuration than the test environment (windows)?


I list Below some files that may help in this verification.


Thank you for any help.


application.js
//= require jquery
//= require jquery-ui
//= require dataTables/jquery.dataTables
//= require_tree .

application.css
*= require_self
*= require dataTables/jquery.dataTables
*= require_tree .
*/

application.rb
class Application < Rails::Application
config.i18n.available_locales = [:en, :"pt-BR"]
config.i18n.default_locale = :"pt-BR"

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]

# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true

config.active_record.whitelist_attributes = true

# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end


production.rb
App::Application.configure do
config.cache_classes = false

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true

# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin

# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict

# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5

# Do not compress assets
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true

config.action_dispatch.x_sendfile_header = "X-Sendfile"

end

Replies

  • allanallan Posts: 63,180Questions: 1Answers: 10,411 Site admin
    edited February 2013
    The DataTables project doesn't provide anything more than a Javascript file and some CSS (fundamentally, there are examples etc obviously, but its really only the main JS and CSS file that you need). There is no Gem provided as part of this project, although there are some3rd party options that I'm aware of. I'd suggest asking the authors of those components / gems?

    All DataTables needs is an HTTP server, which Apache more certain does.

    Allan
  • pash26pash26 Posts: 6Questions: 0Answers: 0
    I'm using https://github.com/rweng/jquery-datatables-rails and we different envs working fine so far. I hope this helps.

    I'm really not sure what the root of the problem you're encountering. I think it's related to how rails handles assets.
This discussion has been closed.