Skip to content

Instantly share code, notes, and snippets.

@americos
Created June 20, 2013 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save americos/5823956 to your computer and use it in GitHub Desktop.
Save americos/5823956 to your computer and use it in GitHub Desktop.
Form
<%= form_for @video, :url => {:action => (@video.new_record? ? 'name_video' : 'update'),
:id => (@video.new_record? ? nil : @video)} do |f| %>
<div id='columnForm'>
<fieldset>
<legend>
Video Information
</legend>
<label for="source_code">Video Source:
<%= f.collection_select('video_source_id',
VideoSource.find(:all).collect, 'id', 'description') %>
</label>
<label for="producer">Producer (First initial + last name. Ex. Bob Smith = bsmith):
<%= f.text_field :producer,
:size => 25,
:maxlength => '15',
:readonly => @readonly,
:value => @video.producer %>
</label>
<label for="expert">Expert (First initial + last name):
<%= f.text_field 'expert_nt_name',
:size => 25, :maxlength => '15', :readonly => @readonly, :value => @video.expert_nt_name %>
</label>
<label for="topic">Topic/City Name (Used in the filename):
<%= f.text_field 'topic',
:size => 25, :maxlength => '30', :readonly => @readonly, :value => @video.topic %>
<span style="font-size:9px">Yahoo Video Cities: chicago, cleveland, dallas, detroit, newyork, sanfrancisco, southbay</span>
</label>
<label for="format">Date (mm-dd-yy):
<%= f.text_field 'format',
:size => 25, :maxlength => '10', :readonly => @readonly, :value => @video.format %>
</label>
<label for="bitrate">Bit Rate:
<%= f.select('bitrate', Video.bitrate_choices, {:include_blank => "Choose..."}) %>
</label>
<label for="category">Video Categories:
<select id="video_category_ids" name="video[category_ids][]" multiple="multiple" size="15" >
<option value="0">Select one</option>
<% Category.root_level.each do |top_cat| -%>
<% if @video.categories.include?(top_cat) -%>
<option value="<%= top_cat.id %>" selected="selected" data-parent='false'><%= h(top_cat.name) %></option>
<% else -%>
<option value="<%= top_cat.id %>" data-parent='false'><%= h(top_cat.name) %></option>
<% end -%>
<%=
$selection_output = ""
Category.build_children_selection_option_tree(top_cat, 0, 'no', @video)
raw $selection_output
%>
<% end -%>
</select>
</label>
<div id="prim_cat" <%= 'style="display:none;"' unless @video.primary_category_id.present? %>>
<%= render(:partial => "shared/primary_categories",
:locals => {:f => f,:primary_categories => @primary_categories,
:primary_subcategories => @primary_subcategories}) %>
</div>
<label for="title">Title for the Video Series (Displayed to users):
<%= f.text_area 'title', :rows => 3, :cols => '50',
:readonly => @readonly, :value => @video.title %><br />
</label>
<label for="description">Brief description for the Video Series:
<%= f.text_area 'description', :rows => 3, :cols => '50',
:readonly => @readonly, :value => @video.description %><br />
</label>
<label for="is_interview">Interview video?
<%= f.check_box 'is_interview', {}, @video.is_interview %>
</label>
<label for="is_private">Private video? (News clips, profiles, etc.)
<%= f.check_box 'is_private', {}, @video.is_private %>
</label>
<label for="suppress_ads">Hide ads for this video? (Should be rarely used)
<%= f.check_box 'suppress_ads', {}, @video.suppress_ads %>
</label>
<label for="is_for_yahoo">Yahoo video? (15 day delay to go live)
<%= f.check_box 'is_for_yahoo', {}, @video.is_for_yahoo %>
</label>
<% unless @readonly %>
<%= submit_tag 'Submit' %>
<% end %>
</fieldset>
</div>
<% end %>
@americos
Copy link
Author

Processing by VideoController#update as HTML (pid:44888)
Parameters: {"utf8"=>"✓", "authenticity_token"=>"NCdmHBn9ipUhRRl4dYEnGQV2vSvms6Aq3S65rWLPdWI=", "video"=>{"video_source_id"=>"1", "producer"=>"testAmerico", "expert_nt_name"=>"Americo", "topic"=>"testTopic", "format"=>"06-20-13", "bitrate"=>"900", "category_ids"=>["1"], "primary_category_id"=>"1", "title"=>"TestTitle", "description"=>"TestDescriptionX", "is_interview"=>"0", "is_private"=>"0", "suppress_ads"=>"0", "is_for_yahoo"=>"0"}, "commit"=>"Submit", "id"=>"9654-testtitle"} (pid:44888)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment