<%= hidden_field_tag 'id', @article.id %> <%= required_fields_message %> <%= required f.text_field(:name) %>
<%= render :file => 'shared/tiny_mce' %> <%= f.text_area(:body, :style => 'width: 98%; height: 400px;', :class => 'mceEditor') %> <%#= labelled_form_field(_('Text'), text_area(@article, :body, :style => 'width: 98%; height: 400px;', :class => 'mceEditor')) %> <%= required f.check_box :allow_new_ideas %>
<%#new articles starts with two choices fields %>
<% if @article.new_record? %> <%= required text_area_tag 'article[choices][]', '', :id => 'choice1' %> <%= required text_area_tag 'article[choices][]', '', :id => 'choice2' %> <% else #already saved pairwise content show one input for each choice%> <% @article.choices.each do |choice_hash| %> <% choice_hash.each do |id, data| %> <%= required text_area_tag "article[choices_saved[#{id}]", data, :id => "choice_#{id}", :disabled => false %> <% end %> <% end %> <% end %>
">