Module ApplicationHelper
In: app/helpers/application_helper.rb

Methods

Public Instance methods

Alternating row style setter

[Source]

    # File app/helpers/application_helper.rb, line 14
14:   def alt( s='', s2='2')
15:     " class='alt#{ cycle( s, s2 ) }'"
16:   end

Collection of table type options appropriate for passing to ActionView::Helpers::FormOptionsHelper.options_for_select

[Source]

    # File app/helpers/application_helper.rb, line 38
38:   def field_type_options( driver )
39:     field_types = get_field_types( driver )
40:     field_types.collect { |ft| [ ft, ft ] }
41:   end

This method Accepts a String or an Array of options and always includes a blank options.

[Source]

    # File app/helpers/application_helper.rb, line 29
29:   def get_options( options, selected )
30:     options = options_for_select( options, selected.to_s ) if options.class == Array
31:     "<option value=''></option>#{ options }"
32:   end

Override @page_title in the view, otheriwse the page gets named ‘Home’.

[Source]

   # File app/helpers/application_helper.rb, line 7
7:   def page_title
8:     @page_title || 'Home'
9:   end

Paginate the rows

[Source]

    # File app/helpers/application_helper.rb, line 21
21:   def row_pagination( total_pages )
22:     render :partial => "database/pagination" if total_pages > 1
23:   end

[Validate]