Module: View::Helper

Defined in:
lib/view/helper.rb

Instance Method Summary (collapse)

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(options = {}, &block)
  definition_list_for(resource, options, &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, options = {}, &block)
  view(value, options.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(options = {}, &block)
  table_for(collection, options.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, options = {}, &block)
  view(value, options.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, options = {}, &block)
  ::View.format(value, options, self, &block)
end