Created
April 12, 2010 14:26
-
-
Save digitalpulp/363609 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
= text_field_tag "page[parts_attributes][#{page_part_counter}][content]", page_part.content.try(:strftime, "%B %d, %Y"), :class => 'date' |
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 DatePagePart < PagePart | |
content :datetime | |
show_filters false | |
part_name "Date Select" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A page part for selecting and storing dates. The view partial uses Radiant's built-in date picker behavior.
The class uses some of PagePart's helpers:
content :datetime
means this part will store its content in a native datetime column instead of treating it as plain text.show_filters false
hides the filter/tag references, since they're not needed for this page part.part_name "Date Select"
sets the label in the part selection dropdown, if we don't want the default of the class name minus "PagePart."