mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
Update README.md
This commit is contained in:
parent
8530fc2aaa
commit
849da797da
1 changed files with 24 additions and 0 deletions
24
README.md
24
README.md
|
|
@ -173,3 +173,27 @@ Paloma.callbacks['users/destroy'] = function(params){
|
|||
alert('User ' + id + ' deleted.');
|
||||
};
|
||||
```
|
||||
|
||||
Callback Chains
|
||||
-
|
||||
Callback chains are created after a redirect action. The chain will continue to increase its length until a render action is detected.
|
||||
|
||||
**Example:**
|
||||
|
||||
```ruby
|
||||
def first_action
|
||||
redirect_to second_action_path
|
||||
end
|
||||
|
||||
def second_action
|
||||
redirect_to third_action_path
|
||||
end
|
||||
|
||||
def third_action
|
||||
render :template => 'third_action_view'
|
||||
end
|
||||
```
|
||||
|
||||
A request for `first_action` will lead to 2 redirects until it reaches the `third_action` and renders a result on the browser. When the `third_action` renders its response, Paloma will execute the callbacks for all the 3 actions.
|
||||
|
||||
The order of execution will be `[controller]/first_action` first, then `[controller]/second_action`, and finally `[controller]/third_action`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue