Skip to content

Instantly share code, notes, and snippets.

@juliend2
Created July 12, 2011 16:34
Show Gist options
  • Save juliend2/1078368 to your computer and use it in GitHub Desktop.
Save juliend2/1078368 to your computer and use it in GitHub Desktop.
review model
class Review < ActiveRecord::Base
# ... some other code here ...
def self.form_fields
[
{:name=>:journalist_name,:type=>:text_field},
{:name=>:publication,:type=>:text_field},
{:name=>:city,:type=>:text_field},
{:name=>:title_en,:type=>:text_field},
{:name=>:title_fr,:type=>:text_field},
{:name=>:short_subtitle_en,:type=>:text_field},
{:name=>:short_subtitle_fr,:type=>:text_field},
{:name=>:full_subtitle_en,:type=>:text_field},
{:name=>:full_subtitle_fr,:type=>:text_field},
{:name=>:quote_en,:type=>:rich_text_area},
{:name=>:quote_fr,:type=>:rich_text_area},
{:name=>:excerpt_en,:type=>:rich_text_area},
{:name=>:excerpt_fr,:type=>:rich_text_area},
{:name=>:long_version_en,:type=>:rich_text_area},
{:name=>:long_version_fr,:type=>:rich_text_area},
{:name=>:acclaim_date,:type=>:date_field,:label=>"Review date"},
{:name=>:audio_set_id, :type=>:select, :options=>AudioSet.all.collect{|a| [a.title, a.id] }+['']},
{:name=>:is_featured, :type=>:check_box},
{:name=>:featured_image, :type=>:image_file_field,:label=>"Feature image"},
{:name=>:feature_doc, :type=>:normal_file_field}
]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment