Last active
December 22, 2015 02:38
-
-
Save kmelkon/6404571 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for [@company, @activity], :remote=> true, :validate => true do |f| %> | |
<%= f.label :title %> | |
<%= f.text_field :title, :class => "input-width bottom-border"%> | |
<%= f.label :background %> | |
<%= f.text_area :background, :class => "area-height area-width bottom-border" %> | |
<%= f.collection_select(:activity_category_id, ActivityCategory.all, :id, :activity_category) %> | |
<%= f.submit "Add activity", class: "btn submit-deals" %> | |
<% end %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for [@company, @deal], :remote=> true, :id => "form", :validate => true do |f| %> | |
<%= f.label :name %> | |
<%= f.text_field :name, :class => "input-width", :autofocus => true %> | |
<%= f.label :value %> | |
<%= f.text_field :value, :class => "input-width" %> | |
<%= f.label :currency %> | |
<%= f.text_field :currency, :class => "input-width" %> | |
<%= f.label :background %> | |
<%= f.text_area :background, :class => "area-width area-height" %> | |
<%= f.submit "Add this Deal", class: "btn submit-deals" %> | |
<% end %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Activity < ActiveRecord::Base | |
attr_accessible :activity_category_id, :background, :title, :user_id | |
belongs_to :company | |
belongs_to :contact | |
belongs_to :activity_category | |
validates :company_id, :presence => true | |
validates :title, :presence => true, | |
:length => {:minimum => 1, :maximum => 20} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Deal < ActiveRecord::Base | |
attr_accessible :background, :company_id, :currency, :deal_category_id, :deal_status_id, :name, :offer, :user_id, :value, :status, :state | |
belongs_to :company | |
belongs_to :deal_catergory | |
belongs_to :deal_status | |
belongs_to :user | |
validates :company_id, :presence => true | |
validates :name, :presence => true, | |
:length => {:minimum => 1, :maximum => 20} | |
validates :value, :presence => true, | |
:numericality => true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uncaught TypeError: Cannot read property 'validators' of undefined | |
_ref.focusout.ClientSideValidations | |
jQuery.event.dispatch | |
elemData.handle | |
jQuery.event.trigger | |
jQuery.event.simulate | |
handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment