Newer
Older
dmpopidor / app / views / dmptemplates / _edit_suggested_answer.html.erb
@Marta Ribeiro Marta Ribeiro on 3 Jun 2016 1 KB DMPonline4 - RAILS 4.0 (#4)
<!--edit suggested answer. question is passed as an argument-->
<%= form_for(suggested_answer, :url => admin_updatesuggestedanswer_dmptemplate_path(suggested_answer), :html => { :method => :put}) do |f| %>
	<%= f.hidden_field :organisation_id, :value => current_user.organisation.id %>

	<table class="dmp_details_table phase">
		<tr>
			<td class="first_template"><%= t('org_admin.questions.suggested_or_example_answer_label')%></td>
			<td>
				<ul>
					<li><%= f.select :is_example, {t('org_admin.questions.example_answer_label') => true, t('org_admin.questions.suggested_answer_label') => false} %></li>
					<li><%= f.text_area :text, :rows => 5 %></li>
				</ul>
			</td>
		</tr>
	</table>
	<br/>

	<!-- submit buttons -->
	<div class="move_2_right">
		<%= f.submit t('helpers.submit.save'), :class => 'btn btn-primary' %>
		<%= link_to t("helpers.submit.delete"), admin_destroysuggestedanswer_dmptemplate_path(:suggested_answer => suggested_answer.id),
			:confirm => t("org_admin.questions.delete_suggested_answer_message", :question_text => question.text ), :method => :delete, :class => "btn btn-primary"%>
		<%= hidden_field_tag :question_id, question.id, :class => "question_id" %>
		<%= link_to t('helpers.submit.cancel'), '#', :class => 'btn cancel cancel_edit_suggested_answer' %>
	</div>
<%end%>