Module: View::Helper
- Defined in:
- lib/view/helper.rb
Instance Method Summary (collapse)
-
- (Object) definition_list(options = {}, &block)
If you're using something like InheritedResource, this will automatically set the definition_list for the current resource, so you'll only need to do:.
-
- (Object) definition_list_for(value, options = {}, &block)
Shortcut for definition_lists.
-
- (Object) table(options = {}, &block)
If you're using something like InheritedResource, this will automatically set the table for the current collection, so you'll only need to do:.
-
- (Object) table_for(value, options = {}, &block)
Shortcut for rendering tables.
-
- (Object) view(value, options = {}, &block)
Use the formatter straight from the view.
Instance Method Details
- (Object) definition_list(options = {}, &block)
If you're using something like InheritedResource, this will automatically set the definition_list for the current resource, so you'll only need to do:
= definition_list
32 33 34 |
# File 'lib/view/helper.rb', line 32 def definition_list( = {}, &block) definition_list_for(resource, , &block) end |
- (Object) definition_list_for(value, options = {}, &block)
Shortcut for definition_lists
24 25 26 |
# File 'lib/view/helper.rb', line 24 def definition_list_for(value, = {}, &block) view(value, .merge(:as => :definition_list), &block) end |
- (Object) table(options = {}, &block)
If you're using something like InheritedResource, this will automatically set the table for the current collection, so you'll only need to do:
= table
19 20 21 |
# File 'lib/view/helper.rb', line 19 def table( = {}, &block) table_for(collection, .merge(:class => resource_class), &block) end |
- (Object) table_for(value, options = {}, &block)
Shortcut for rendering tables
11 12 13 |
# File 'lib/view/helper.rb', line 11 def table_for(value, = {}, &block) view(value, .merge(:as => :table), &block) end |
- (Object) view(value, options = {}, &block)
Use the formatter straight from the view
6 7 8 |
# File 'lib/view/helper.rb', line 6 def view(value, = {}, &block) ::View.format(value, , self, &block) end |