<commit_before><%= simple_form_for [@use_case.project, @use_case], :html => { :class => 'form-horizontal' } do |f| %>
  <div class="well">
    <% if params[:action] == "attach_document" %>
      <%= f.association :document_projects,
                        :collectoin => DocumentProject.where(:project_id => @project),
                        :as => :check_boxes %>
      <%= f.hidden_field :data, :hidden => true, :value => @use_case.data %>
      </div>
    <% else %>
    	<%= f.input :name %>
      <%= f.association :use_case_group, 
                        :collection => UseCaseGroup.where(:project_id => @project),
                        :input_html => { class: 'chosen-select selectpicker'} %>
      <%= f.association :requirement, 
                        :collection => Requirement.where(:project_id => @project), 
                        :input_html => { class: 'chosen-select'} %>
      <%= f.association :tasks, 
                        :collection => Task.where(:project_id => @project), 
                        :input_html => { class: 'chosen-select'} %>
      <%= f.association :document_projects,
                        :collectoin => DocumentProject.where(:project_id => @project),
                        :input_html => { class: 'chosen-select'} %>
    	<%= f.association :use_case_template,
                        :collection => UseCaseTemplate.where(:project_id => @project),
    					          :input_html => { class: 'chosen-select selectpicker'},
                        :include_blank => true %>
    </div>
    <div id="template">
      <% if params[:action] == "edit" %>
        <%= render 'template_form', :@json_obj => JSON.parse(@use_case.use_case_template.template_form),
                                    :@data => JSON.parse(@use_case.data) %>
      <% end %>
    </div>
  <% end %>

  <div class="form-actions">
    <%= f.button :submit, :class => 'btn-primary' %>
    <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                project_use_cases_path, :class => 'btn' %>
  </div>
<% end %>

<% content_for :javascripts do %>
	<script type="text/javascript">
    $(chosenSelect(200));
		$('#use_case_use_case_template_id').change(function(){
			var use_case_template_id = $(this).val();
			var response = $.ajax({
  									url: "<%= template_use_case_project_use_cases_path %>",
					  				data: {use_case_template_id: use_case_template_id}
							}).done(function(){
								chosenSelect(200);
							});
		});
	</script>
<% end %>
<commit_msg>Fix on use case form (document_project collectoin)<commit_after><%= simple_form_for [@use_case.project, @use_case], :html => { :class => 'form-horizontal' } do |f| %>
  <div class="well">
    <% if params[:action] == "attach_document" %>
      <%= f.association :document_projects,
                        :collectoin => DocumentProject.where(:project_id => @project),
                        :as => :check_boxes %>
      <%= f.hidden_field :data, :hidden => true, :value => @use_case.data %>
      </div>
    <% else %>
    	<%= f.input :name %>
      <%= f.association :use_case_group, 
                        :collection => UseCaseGroup.where(:project_id => @project),
                        :input_html => { class: 'chosen-select selectpicker'} %>
      <%= f.association :requirement, 
                        :collection => Requirement.where(:project_id => @project), 
                        :input_html => { class: 'chosen-select'} %>
      <%= f.association :tasks, 
                        :collection => Task.where(:project_id => @project), 
                        :input_html => { class: 'chosen-select'} %>
      <%= f.association :document_projects,
                        :collection => DocumentProject.where(:project_id => @project),
                        :input_html => { class: 'chosen-select'} %>
    	<%= f.association :use_case_template,
                        :collection => UseCaseTemplate.where(:project_id => @project),
    					          :input_html => { class: 'chosen-select selectpicker'},
                        :include_blank => true %>
    </div>
    <div id="template">
      <% if params[:action] == "edit" %>
        <%= render 'template_form', :@json_obj => JSON.parse(@use_case.use_case_template.template_form),
                                    :@data => JSON.parse(@use_case.data) %>
      <% end %>
    </div>
  <% end %>

  <div class="form-actions">
    <%= f.button :submit, :class => 'btn-primary' %>
    <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                project_use_cases_path, :class => 'btn' %>
  </div>
<% end %>

<% content_for :javascripts do %>
	<script type="text/javascript">
    $(chosenSelect(200));
		$('#use_case_use_case_template_id').change(function(){
			var use_case_template_id = $(this).val();
			var response = $.ajax({
  									url: "<%= template_use_case_project_use_cases_path %>",
					  				data: {use_case_template_id: use_case_template_id}
							}).done(function(){
								chosenSelect(200);
							});
		});
	</script>
<% end %>

{'fraction_non_alphanumeric': 0.17091988130563798, 'fraction_numerical': 0.002373887240356083, 'mean_word_length': 2.202026599113363, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503389', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1473, 'n_words': 260}