Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ncri committed Oct 5, 2012
1 parent 2e009cc commit c06f589
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ And then, on the client side hook into Ajaxify using the `handle_extra_content`
Ajaxify.handle_extra_content = ->
$('#my_fancy_widget').html $('#ajaxify_content #my_fancy_widget_html').html()

Tip: you can call view helpers to render extra content from within your controller using the view_context:

def ajaxify_extra_content
view_context.my_fancy_widget
end

### Reference: All Javascript Options and Callbacks

Here is a reference of all options and callbacks you can set on the client side via `Ajaxify.<i>option_or_callback</i> =` :
Here is a reference of all options and callbacks you can set on the client side via Ajaxify.<i>option_or_callback</i> = :

Option/Callback Default Description

Expand All @@ -166,7 +171,7 @@ Here is a reference of all options and callbacks you can set on the client side
on_before_load null Callback: Called before the ajaxify request is started.
on_success null Callback: Called when an ajaxify requests finished successfully.
on_success_once null Callback: Like on_success but only called once.
handle_extra_content null Callback: Called before extra content is stripped from the ajax request's response.
handle_extra_content null Callback: Called before extra content is stripped from the Ajax request's response.

flash_types ['notice'] Flash types your Rails app uses. E.g. ['notice', 'warning', 'error']
flash_effect null Callback: Called for each flash type after flash is set.
Expand Down

0 comments on commit c06f589

Please sign in to comment.