1
0
Fork 0
mirror of https://github.com/kbparagua/paloma synced 2023-03-27 23:21:17 -04:00

Update README.md

This commit is contained in:
Karl Bryan Paragua 2013-10-12 21:05:06 +08:00
parent 49f5199ede
commit 9a74575c1e

View file

@ -20,10 +20,10 @@ All the generator shits are also gone. So developers need not to follow specific
Paloma controller.
```javascript
var User = Paloma.controller('User');
var UsersController = Paloma.controller('Users');
// Executes when Rails User#new is rendered.
User.prototype.new = function(){
UsersController.prototype.new = function(){
alert('Hello Sexy User!' );
};
```
@ -64,6 +64,20 @@ Require `paloma` in your `application.js`:
//= require paloma
```
# Router
Router is responsible for mapping Rails controller/action to its equivalent Paloma controller/action.
By default all Rails controller/action will be mapped with a Paloma controller/action with the same resource name (controller name without the `Controller` suffix).
Example:
* Response from `UsersController#new` will be mapped to `Users` Paloma controller and execute its `new` method.
# Controller
# Advanced Callbacks
-
By default Paloma will execute the callback that matches the current controller and action if it finds one.