Sha256: 5099373e5f3ef1e153166530e9b8e11cf7421a0e05d3d4d995f4a880f225227f

Contents?: true

Size: 795 Bytes

Versions: 4

Compression:

Stored size: 795 Bytes

Contents

class UpdateContactForm
  
  def self.up
    fields = []

    fields << DynamicFormField.textfield({:fieldLabel => 'First Name', :name => 'first_name', :width => 250, :allowBlank => false })
    fields << DynamicFormField.textfield({:fieldLabel => 'Last Name', :name => 'last_name', :width => 250, :allowBlank => false })
    fields << DynamicFormField.email({:fieldLabel => 'Email', :name => 'email', :width => 250, :allowBlank => false })
    fields << DynamicFormField.textarea({:fieldLabel => 'Message', :name => 'message', :width => 400, :height => 200, :allowBlank => false })    
    
    d = DynamicForm.find_by_internal_identifier('contact_us')
    unless d.nil?
      d.definition = fields.to_json
      d.save    
    end    
  end
  
  def self.down
    #remove data here
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
erp_forms-2.0.6 db/data_migrations/20120904191738_update_contact_form.rb
erp_forms-2.0.5 db/data_migrations/20120904191738_update_contact_form.rb
erp_forms-2.0.4 db/data_migrations/20120904191738_update_contact_form.rb
erp_forms-2.0.3 db/data_migrations/20120904191738_update_contact_form.rb