reporta-modules 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +203 -0
- data/Rakefile +20 -0
- data/lib/generators/reporta/views_generator.rb +24 -0
- data/lib/generators/templates/reports/_box.html.erb +48 -0
- data/lib/generators/templates/reports/_chartjs_bar.html.erb +31 -0
- data/lib/generators/templates/reports/_chartjs_line.html.erb +33 -0
- data/lib/generators/templates/reports/_chartjs_pie.html.erb +19 -0
- data/lib/generators/templates/reports/_filters.html.erb +100 -0
- data/lib/generators/templates/reports/_table.html.erb +49 -0
- data/lib/reporta-modules.rb +15 -0
- data/lib/reporta/box_helper.rb +17 -0
- data/lib/reporta/chartjs_helper.rb +74 -0
- data/lib/reporta/models/column.rb +68 -0
- data/lib/reporta/models/filter.rb +42 -0
- data/lib/reporta/models/form.rb +77 -0
- data/lib/reporta/models/reportable.rb +50 -0
- data/lib/reporta/railtie.rb +8 -0
- data/lib/reporta/version.rb +3 -0
- data/lib/reporta/view_helper.rb +38 -0
- data/lib/tasks/reporta_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +18 -0
- data/spec/dummy/app/assets/javascripts/jquery.dataTables.js +12099 -0
- data/spec/dummy/app/assets/javascripts/jquery.flot.js +3061 -0
- data/spec/dummy/app/assets/javascripts/jquery.flot.time.js +431 -0
- data/spec/dummy/app/assets/javascripts/jquery.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +14 -0
- data/spec/dummy/app/assets/stylesheets/bootstrap.min.css +9 -0
- data/spec/dummy/app/assets/stylesheets/style.css +57 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/reports_controller.rb +18 -0
- data/spec/dummy/app/helpers/application_helper.rb +5 -0
- data/spec/dummy/app/models/account.rb +3 -0
- data/spec/dummy/app/models/account_chart.rb +41 -0
- data/spec/dummy/app/models/account_report.rb +39 -0
- data/spec/dummy/app/models/user.rb +8 -0
- data/spec/dummy/app/views/layouts/application.html.erb +28 -0
- data/spec/dummy/app/views/reports/chart.html.erb +6 -0
- data/spec/dummy/app/views/reports/dynamic_table.html.erb +33 -0
- data/spec/dummy/app/views/reports/dynamic_table_with_bootstrap.html.erb +37 -0
- data/spec/dummy/app/views/reports/overview.html.erb +4 -0
- data/spec/dummy/app/views/reports/table.html.erb +12 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +7 -0
- data/spec/dummy/db/migrate/20130622041213_create_users.rb +14 -0
- data/spec/dummy/db/migrate/20130623054801_create_accounts.rb +9 -0
- data/spec/dummy/db/schema.rb +33 -0
- data/spec/dummy/db/seeds.rb +20 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +1190 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/models/column_spec.rb +76 -0
- data/spec/models/filter_spec.rb +63 -0
- data/spec/models/form_spec.rb +81 -0
- data/spec/models/report_spec.rb +51 -0
- data/spec/spec_helper.rb +43 -0
- metadata +247 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
body { padding: 20px 0; }
|
2
|
+
.highlight { background: rgb(255, 255, 187); }
|
3
|
+
.chart {
|
4
|
+
width: 100%;
|
5
|
+
height: 300px;
|
6
|
+
}
|
7
|
+
.filters {
|
8
|
+
margin-bottom: 10px;
|
9
|
+
padding: 10px;
|
10
|
+
background: rgb(243, 243, 243);
|
11
|
+
-webkit-border-radius: 6px;
|
12
|
+
-moz-border-radius: 6px;
|
13
|
+
border-radius: 6px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.no-bootstap select { width: auto; }
|
17
|
+
|
18
|
+
/* The .bs-docs-sidenav styles a lovingly stolen from the Bootstrap demo site. */
|
19
|
+
.bs-docs-sidenav {
|
20
|
+
width: 228px;
|
21
|
+
margin: 20px 0 0 0;;
|
22
|
+
padding: 0;
|
23
|
+
background-color: #fff;
|
24
|
+
-webkit-border-radius: 6px;
|
25
|
+
-moz-border-radius: 6px;
|
26
|
+
border-radius: 6px;
|
27
|
+
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
|
28
|
+
-moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
|
29
|
+
box-shadow: 0 1px 4px rgba(0,0,0,.065);
|
30
|
+
}
|
31
|
+
.bs-docs-sidenav > li > a {
|
32
|
+
display: block;
|
33
|
+
width: 190px \9;
|
34
|
+
margin: 0 0 -1px;
|
35
|
+
padding: 8px 14px;
|
36
|
+
border: 1px solid #e5e5e5;
|
37
|
+
}
|
38
|
+
.bs-docs-sidenav > li:first-child > a {
|
39
|
+
-webkit-border-radius: 6px 6px 0 0;
|
40
|
+
-moz-border-radius: 6px 6px 0 0;
|
41
|
+
border-radius: 6px 6px 0 0;
|
42
|
+
}
|
43
|
+
.bs-docs-sidenav > li:last-child > a {
|
44
|
+
-webkit-border-radius: 0 0 6px 6px;
|
45
|
+
-moz-border-radius: 0 0 6px 6px;
|
46
|
+
border-radius: 0 0 6px 6px;
|
47
|
+
}
|
48
|
+
.bs-docs-sidenav > .active > a {
|
49
|
+
position: relative;
|
50
|
+
z-index: 2;
|
51
|
+
padding: 9px 15px;
|
52
|
+
border: 0;
|
53
|
+
text-shadow: 0 1px 0 rgba(0,0,0,.15);
|
54
|
+
-webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
|
55
|
+
-moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
|
56
|
+
box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
|
57
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class ReportsController < ApplicationController
|
2
|
+
|
3
|
+
def table
|
4
|
+
@report = AccountReport.new(params[:form])
|
5
|
+
end
|
6
|
+
|
7
|
+
def dynamic_table
|
8
|
+
@report = AccountReport.new(params[:form])
|
9
|
+
end
|
10
|
+
|
11
|
+
def dynamic_table_with_bootstrap
|
12
|
+
@report = AccountReport.new(params[:form])
|
13
|
+
end
|
14
|
+
|
15
|
+
def chart
|
16
|
+
@report = AccountChart.new(params[:form])
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
class AccountChart
|
2
|
+
include Reporta::Report
|
3
|
+
|
4
|
+
filter :gender, collection: %w(Any Male Female), include_blank: false
|
5
|
+
|
6
|
+
x_axis :months, as: :date, format: "%Y-%m-%d"
|
7
|
+
y_axis :accounts, title: 'Total Accounts'
|
8
|
+
|
9
|
+
line_chart :sign_ups
|
10
|
+
column_chart :average_age, line_width: 20, align: :left
|
11
|
+
|
12
|
+
def months
|
13
|
+
@months ||= (1..12).map { |month| Date.new(Date.today.year, month) }
|
14
|
+
end
|
15
|
+
|
16
|
+
def sign_ups(month)
|
17
|
+
total = accounts_by_month[month.to_date].to_a.size
|
18
|
+
[month.to_time.to_i * 1000, total]
|
19
|
+
end
|
20
|
+
|
21
|
+
def average_age(month)
|
22
|
+
accounts = accounts_by_month[month.to_date]
|
23
|
+
average = accounts.sum(&:age) / accounts.size
|
24
|
+
[month.to_time.to_i * 1000, average]
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def accounts_by_month
|
30
|
+
@accounts_by_month ||= begin
|
31
|
+
users = User.all
|
32
|
+
if gender.present? && gender != 'Any'
|
33
|
+
users = users.where(gender: gender)
|
34
|
+
end
|
35
|
+
users.group_by do |account|
|
36
|
+
account.created_at.beginning_of_month.to_date
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class AccountReport
|
2
|
+
include Reporta::Report
|
3
|
+
|
4
|
+
filter :first_name
|
5
|
+
filter :age
|
6
|
+
filter :gender, collection: %w(Any Male Female), include_blank: false
|
7
|
+
filter :active, as: :boolean
|
8
|
+
|
9
|
+
column :first_name, helper: :mailto
|
10
|
+
column :last_name
|
11
|
+
column :age, class_names: 'highlight'
|
12
|
+
column :gender
|
13
|
+
column :active, title: 'Enabled'
|
14
|
+
column :account, data_chain: 'account.name'
|
15
|
+
column :created
|
16
|
+
|
17
|
+
def rows
|
18
|
+
users = User.where(active: active)
|
19
|
+
|
20
|
+
# Filter by substring match on first_name
|
21
|
+
if first_name.present?
|
22
|
+
users = users.where("LOWER(users.first_name) LIKE '%#{first_name.downcase}%'")
|
23
|
+
end
|
24
|
+
|
25
|
+
# Filter by selecte age
|
26
|
+
users = users.where(age: age) if age.present?
|
27
|
+
|
28
|
+
# Filter by gender unless the 'Any' option is selected
|
29
|
+
if gender.present? && gender != 'Any'
|
30
|
+
users = users.where(gender: gender)
|
31
|
+
end
|
32
|
+
|
33
|
+
users
|
34
|
+
end
|
35
|
+
|
36
|
+
def created(user)
|
37
|
+
user.created_at.strftime("%b %d, %Y")
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag "application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "application" %>
|
7
|
+
<%= content_for :head %>
|
8
|
+
<%= csrf_meta_tags %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div class="container">
|
12
|
+
<div class="row">
|
13
|
+
<div class="span3">
|
14
|
+
<ul class="nav nav-list bs-docs-sidenav affix">
|
15
|
+
<li><%= link_to 'Overview', '/' %></li>
|
16
|
+
<li><%= link_to 'Basic Table', '/table' %></li>
|
17
|
+
<li><%= link_to 'Dynamic Table', '/dynamic_table' %></li>
|
18
|
+
<li><%= link_to 'Dynamic Table With Bootstrap', '/dynamic_table_with_bootstrap' %></li>
|
19
|
+
<li><%= link_to 'Basic Chart', '/chart' %></li>
|
20
|
+
</ul>
|
21
|
+
</div>
|
22
|
+
<div class="span9">
|
23
|
+
<%= yield %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<h2>Dynamic Table</h2>
|
2
|
+
<p>To create a table with client side pagination, inline filtering and other dynamic goodies you first need to include some Javascript files. The Reporta dynamic tables use <%= link_to 'DataTables', 'http://datatables.net/index' %> under the hood so anything you can do with DataTables you can do here as well.</p>
|
3
|
+
<p>If you don't already have it you will need a copy of <%= link_to 'jQuery', 'http://jquery.com/' %> and <%= link_to 'DataTables', 'http://datatables.net/download/' %> in your app/assets/javascripts directory</p>
|
4
|
+
<p>In your application.js file make sure you have the following lines in this order:</p>
|
5
|
+
<blockquote>#= require jquery<br/>
|
6
|
+
#= require jquery.dataTables<br/>
|
7
|
+
#= require reporta/dataTables
|
8
|
+
</blockquote>
|
9
|
+
<p>Now the dependencies are loaded we can display the report below like this:</p>
|
10
|
+
<blockquote><%%= filters_for(@report) %><br />
|
11
|
+
<%%= table_for(@report, class_name: 'table') %><br />
|
12
|
+
<script type="text/javascript" charset="utf-8"><br />
|
13
|
+
  $(function() {<br />
|
14
|
+
    new Reporta.DynamicTable('.table');<br />
|
15
|
+
  });<br />
|
16
|
+
</script><br />
|
17
|
+
</blockquote>
|
18
|
+
<p>The only difference between this and the <%= link_to 'Basic Table', '/table' %> is we added the extra Javascript that is called after the page is loaded to make the table dynamic.</p>
|
19
|
+
<p><strong>Note:</strong> As we are using Bootstrap here on the demo page the styling below is not quite right. It should look more like a deafult DataTable on your page. If you are using Bootstrap checkout the <%= link_to 'Dynamic Table With Bootstrap', '/dynamic_table_with_bootstrap' %> page.</p>
|
20
|
+
|
21
|
+
<h3>Example</h3>
|
22
|
+
<div class="filters">
|
23
|
+
<%= filters_for(@report) %>
|
24
|
+
</div>
|
25
|
+
<div class="no-bootstap">
|
26
|
+
<%= table_for(@report, class_name: 'table') %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
$(function() {
|
31
|
+
new Reporta.DynamicTable('.table');
|
32
|
+
});
|
33
|
+
</script>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<%= content_for :head do %>
|
2
|
+
<%= javascript_include_tag "reporta/dataTables.bootstrap" %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<h2>Dynamic Table With Bootstrap</h2>
|
6
|
+
<p>To get the data table looking nice with Bootstrap there is a few things that need to happen. First we need to make sure the following in you application.js file (note the extra dataTables.bootstrap file)</p>
|
7
|
+
<blockquote>#= require jquery<br />
|
8
|
+
#= require jquery.dataTables<br />
|
9
|
+
#= require reporta/dataTables<br />
|
10
|
+
#= require reporta/dataTables.bootstrap<br />
|
11
|
+
</blockquote>
|
12
|
+
<p>Now you can display the report like this:</p>
|
13
|
+
<blockquote><%%= filters_for(@report) %><br />
|
14
|
+
<%%= table_for(@report, class_name: 'table') %><br />
|
15
|
+
<script type="text/javascript" charset="utf-8"><br />
|
16
|
+
  $(function() {<br />
|
17
|
+
    new Reporta.DynamicTable('.table.dynamic', { bootstrap: true });<br />
|
18
|
+
  });<br />
|
19
|
+
</script><br />
|
20
|
+
</blockquote>
|
21
|
+
<p>The only difference between this and the <%= link_to 'Dynamic Table', '/dynamic_table' %> example is the extra Javascript file and passing bootstrap: true to Reporta.DynamicTable.</p>
|
22
|
+
<h3>Example</h3>
|
23
|
+
<div class="filters">
|
24
|
+
<%= filters_for(@report) %>
|
25
|
+
</div>
|
26
|
+
<div class="no-bootstap">
|
27
|
+
<%= table_for(@report, class_name: 'table dynamic') %>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<script type="text/javascript" charset="utf-8">
|
31
|
+
$(function() {
|
32
|
+
new Reporta.DynamicTable('.table.dynamic', {
|
33
|
+
bootstrap: true
|
34
|
+
});
|
35
|
+
});
|
36
|
+
</script>
|
37
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h2>Basic Table</h2>
|
2
|
+
<p>To output your report as a table you must define a method named <strong>rows</strong> and at least 1 <strong>column</strong> within you report class. This method should return an array (or other enumerable object) with each item representing a row in the table.</p>
|
3
|
+
<p>The filtering form and the table below are output using the following 2 helpers.</p>
|
4
|
+
<blockquote><%%= filters_for(@report) %><br />
|
5
|
+
<%%= table_for(@report, class_name: 'table') %>
|
6
|
+
</blockquote>
|
7
|
+
<p>The class_name option sets the class of the generated table, here we are setting it to "table" so Bootstrap will add some basic styling</p>
|
8
|
+
<h3>Example</h3>
|
9
|
+
<div class="filters">
|
10
|
+
<%= filters_for(@report) %>
|
11
|
+
</div>
|
12
|
+
<%= table_for(@report, class_name: 'table') %>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
require "reporta-modules"
|
7
|
+
|
8
|
+
module Dummy
|
9
|
+
class Application < Rails::Application
|
10
|
+
# Settings in config/environments/* take precedence over those specified here.
|
11
|
+
# Application configuration should go into files in config/initializers
|
12
|
+
# -- all .rb files in that directory are automatically loaded.
|
13
|
+
|
14
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
15
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
16
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
17
|
+
|
18
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
19
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
20
|
+
# config.i18n.default_locale = :de
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
development:
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/development.sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: db/test.sqlite3
|
18
|
+
pool: 5
|
19
|
+
timeout: 5000
|
20
|
+
|
21
|
+
production:
|
22
|
+
adapter: sqlite3
|
23
|
+
database: db/production.sqlite3
|
24
|
+
pool: 5
|
25
|
+
timeout: 5000
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both thread web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
+
config.serve_static_assets = false
|
24
|
+
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
28
|
+
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
+
config.assets.compile = false
|
31
|
+
|
32
|
+
# Generate digests for assets URLs.
|
33
|
+
config.assets.digest = true
|
34
|
+
|
35
|
+
# Version of your assets, change this if you want to expire all your assets.
|
36
|
+
config.assets.version = '1.0'
|
37
|
+
|
38
|
+
# Specifies the header that your server uses for sending files.
|
39
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
40
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
41
|
+
|
42
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
|
+
# config.force_ssl = true
|
44
|
+
|
45
|
+
# Set to :debug to see everything in the log.
|
46
|
+
config.log_level = :info
|
47
|
+
|
48
|
+
# Prepend all log lines with the following tags.
|
49
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
50
|
+
|
51
|
+
# Use a different logger for distributed setups.
|
52
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
53
|
+
|
54
|
+
# Use a different cache store in production.
|
55
|
+
# config.cache_store = :mem_cache_store
|
56
|
+
|
57
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
58
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
59
|
+
|
60
|
+
# Precompile additional assets.
|
61
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
62
|
+
# config.assets.precompile += %w( search.js )
|
63
|
+
|
64
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
65
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
66
|
+
# config.action_mailer.raise_delivery_errors = false
|
67
|
+
|
68
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
69
|
+
# the I18n.default_locale when a translation can not be found).
|
70
|
+
config.i18n.fallbacks = true
|
71
|
+
|
72
|
+
# Send deprecation notices to registered listeners.
|
73
|
+
config.active_support.deprecation = :notify
|
74
|
+
|
75
|
+
# Disable automatic flushing of the log to improve performance.
|
76
|
+
# config.autoflush_log = false
|
77
|
+
|
78
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
+
config.log_formatter = ::Logger::Formatter.new
|
80
|
+
end
|