-
Notifications
You must be signed in to change notification settings - Fork 330
Custom respond_to
scambra edited this page Sep 14, 2010
·
10 revisions
If you want to add some formats to actions’ responses you can add some methods named #{action_name}_respond_to
. That method will be invoked with type as parameter.
Example:
def show_respond_to(type)
type.pdf # It will render a template named show.pdf.<template_handler>
end
You can define the following methods:
- new_respond_to
- create_respond_to
- edit_respond_to
- update_respond_to
- show_respond_to
- destroy_respond_to
- show_search_respond_to
- update_table_respond_to
- list_respond_to
- nested_respond_to
- new_existing_respond_to
- add_existing_respond_to
- destroy_existing_respond_to