aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Florisson2014-02-27 10:00:08 +0100
committerMarc Florisson2014-02-27 10:00:08 +0100
commit26cf7a3d70273006abf7b3757d0283aa2f6c87ea (patch)
tree6ebe17065fabb92881d3b6825b1706be24c356e1
parent013e5ac7b968b5a9f419d1a4d70a1eec20c49bac (diff)
parent73f3494eb3cb920ac9ce79da48c2636adcea146e (diff)
downloadchouette-core-26cf7a3d70273006abf7b3757d0283aa2f6c87ea.tar.bz2
Merge branch 'V2_2'
-rw-r--r--README.md12
-rw-r--r--app/models/help_page.rb6
-rw-r--r--config/environments/production.rb2
3 files changed, 14 insertions, 6 deletions
diff --git a/README.md b/README.md
index dedd23d26..2913c5ae3 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,7 @@ Requirements
This code has been run and tested on [Travis](http://travis-ci.org/afimb/chouette2?branch=master) with :
* Ruby 1.9.3
+* Java 7
* Postgres 9.x
* Proj 4.8.0
@@ -83,8 +84,12 @@ Create [Postgres database user] (./doc/install/postgresql.md)
Create database and its schema
```sh
-RAILS_ENV=production bundle exec rake db:create
-RAILS_ENV=production bundle exec rake apartment:migrate
+RAILS_ENV=production bundle exec rake db:create apartment:migrate
+```
+
+Prepare static resources (assets)
+```sh
+RAILS_ENV=production bundle exec rake assets:clean assets:precompile
```
The next step assume default path defined by following settings in file [production.rb](./config/environments/production.rb) are unchanged
@@ -138,6 +143,9 @@ RAILS_ENV=production bundle exec rails server
This task may be added in system start up configuration.
Instead of using WEBrick, Rails application may be deployed on [Pushion Passenger](https://www.phusionpassenger.com/) with an [Apache](http://httpd.apache.org/) or [NGinx](http://nginx.com/) front-end, to make server faster and more robust.
+Apache like NGinx can serve static resources
+so, change parameter ```serve_static_assets``` to false in [production.rb](./config/environments/production.rb)
+
Test
----
diff --git a/app/models/help_page.rb b/app/models/help_page.rb
index ea9d34e44..064cdc680 100644
--- a/app/models/help_page.rb
+++ b/app/models/help_page.rb
@@ -21,10 +21,10 @@ class HelpPage
self.data ||= {}
if self.content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
- self.content = $POSTMATCH
+ self.content = $' # cryptic name for $POSTMATCH, but since V2.2
self.data.merge! YAML.load($1)
end
-
+
# workaround for special chars
self.content = self.content.gsub('é','é')
self.content = self.content.gsub('è','è')
@@ -66,7 +66,7 @@ class HelpPage
if page.exists?
page.load
else
- raise ActiveRecord::RecordNotFound
+ raise ActiveRecord::RecordNotFound
end
end
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 5cb2ca6e0..9e08d4145 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -12,7 +12,7 @@ ChouetteIhm::Application.configure do
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_assets = false
+ config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = false