diff --git a/test_app/spec/javascripts/controller_builder_spec.js b/test_app/spec/javascripts/controller_builder_spec.js index 2505e8a..a2badea 100644 --- a/test_app/spec/javascripts/controller_builder_spec.js +++ b/test_app/spec/javascripts/controller_builder_spec.js @@ -32,13 +32,14 @@ describe('Paloma.ControllerBuilder', function(){ }); it("initializes controller instance's params", function(){ - var expectedParams = {_controller: 'Test', _action: 'show', a: 1, b: 2}; + var expectedParams = {a: 1, b: 2}; var correct = true; - for (var k in expectedParams){ - if (controller.params[k] != expectedParams[k]) - correct = false; - } + for (var k in expectedParams) + if (controller.params[k] != expectedParams[k]) correct = false; + + for (var k in controller.params) + if (expectedParams[k] != controller.params[k]) correct = false; expect(correct).toBeTruthy(); }); diff --git a/vendor/assets/javascripts/paloma/controller_builder.js b/vendor/assets/javascripts/paloma/controller_builder.js index f46ca93..482b385 100644 --- a/vendor/assets/javascripts/paloma/controller_builder.js +++ b/vendor/assets/javascripts/paloma/controller_builder.js @@ -19,11 +19,8 @@ Paloma.ControllerBuilder.prototype = { }, _buildParams: function(){ - var params = { - _controller: this.options.controller, - _action: this.options.action - }; - + var params = {}; + for (var k in this.options.params) if (this.options.params.hasOwnProperty(k)) params[k] = this.options.params[k];