Browse files

Merge branch 'master' into develop

  • Loading branch information...
2 parents 15fcb9e + 91f048e commit 80f66aafae2a79add4ab537a216c51f20874dd33 @1602 1602 committed Aug 31, 2011
@@ -297,8 +297,8 @@ or it's shortcut
railway c
-It just simple node-js console with some Railway bingings, e.g. models. Just one note
-about working with console. Node.js is asunchronous by his nature, and it's great
+It just simple node-js console with some Railway bindings, e.g. models. Just one note
+about working with console. Node.js is asynchronous by its nature, and it's great
but it made console debugging much more complicated, because you should use callback
to fetch result from database, for example. I have added one useful method to
simplify async debugging using railway console. It's name `c`, you can pass it
@@ -327,7 +327,7 @@ Localization
To add another language to app just create yml file in `config/locales`,
for example `config/locales/jp.yml`, copy contents of `config/locales/en.yml` to new
file and rename root node (`en` to `jp` in that case), also in `lang` section rename
-`name` to Japaneese (for example).
+`name` to Japanese (for example).
Next step - rename email files in `app/views/emails`, copy all files `*.en.html`
and `*.en.text` to `*.jp.html` and `*.jp.text` and translate new files.
@@ -222,6 +222,11 @@ Controller.prototype.render = function (arg1, arg2) {
var layout = this.layout(),
file = this.controllerFullName + '/' + view;
+ if (this.response.renderCalled) {
+ log('Rendering', $(file).grey, 'using layout', $(layout).grey, 'called twice.', $('render() can be called only once!').red);
+ return;
+ }
try {
var helper = require(app.root + '/app/helpers/' + this.controllerFullName + '_helper');
} catch (e) {
@@ -232,6 +237,7 @@ Controller.prototype.render = function (arg1, arg2) {
var helpers = railway.helpers.personalize(this);
+ this.response.renderCalled = true;
this.response.render(file, {
locals: safe_merge(params, this.request.sandbox, path_to, helpers, helpers.__proto__, helper),
layout: layout ? 'layouts/' + layout : false,
Oops, something went wrong.

0 comments on commit 80f66aa

Please sign in to comment.