Created
March 17, 2009 14:41
-
-
Save patrickberkeley/80566 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(@event) do |f| %> | |
<%= f.error_messages %> | |
<p> | |
<%= f.label :title %><br /> | |
<%= f.text_field :title %> | |
</p> | |
<p> | |
<%= f.label :permalink %><br /> | |
<%= f.text_field :permalink %> | |
</p> | |
<p> | |
<%= f.label :description %><br /> | |
<%= f.text_area :description %> | |
</p> | |
<p> | |
<%= f.label :start_date %><br /> | |
<%= f.datetime_text_field :start_date, :blank => true %> | |
</p> | |
<p> | |
<%= f.label :end_date %><br /> | |
<%= f.datetime_text_field :end_date, :blank => true %> | |
</p> | |
<p> | |
<%= f.label :location %><br /> | |
<%= f.text_area :location %> | |
</p> | |
<p> | |
<%= f.submit button_name, :class => "button" %> | |
</p> | |
<% end %> | |
<%= link_to 'Cancel', events_path %> |
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 Event < ActiveRecord::Base | |
validates_presence_of :title, :permalink | |
validates_datetime :start_date, :allow_nil => true, :allow_blank => true | |
validates_datetime :end_date, :allow_nil => true, :allow_blank => true | |
def to_param | |
permalink | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment