Sha256: d0aa922686e6d169124897c4e47c1c5a6601c11c08bd16d00746d0110e93e5c7

Contents?: true

Size: 573 Bytes

Versions: 3

Compression:

Stored size: 573 Bytes

Contents

module MegaBar
  module FieldsHelper
    def pre_render
      if params[:action] == 'edit' 
        # these are for some virtual attributes.
        @index_field_display = FieldDisplay.by_fields(@model.id).by_action('index').present? ? 'y':'' 
        @show_field_display = FieldDisplay.by_fields(@model.id).by_action('show').present? ? 'y':'' 
        @new_field_display = FieldDisplay.by_fields(@model.id).by_action('new').present? ? 'y':'' 
        @edit_field_display = FieldDisplay.by_fields(@model.id).by_action('edit').present? ? 'y':'' 
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mega_bar-0.5.2 app/helpers/mega_bar/fields_helper.rb
mega_bar-0.5.1 app/helpers/mega_bar/fields_helper.rb
mega_bar-0.0.1 app/helpers/mega_bar/fields_helper.rb