admin can assign reviewrs to quiz
This commit is contained in:
parent
3bd9d3364c
commit
96250c4521
@ -45,7 +45,7 @@ module Admin
|
||||
private
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(:name, :email, :role, :password)
|
||||
params.require(:user).permit(:name, :email, :role, :password, quiz_ids: [])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -15,5 +15,12 @@
|
||||
<%= form.select :role, admin_role_options(user.role), include_blank: false %>
|
||||
</div>
|
||||
|
||||
<%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {}, {class: 'checkbox'}) do | quiz | %>
|
||||
<div class="form-group-multiples">
|
||||
<%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %>
|
||||
<%= quiz.label %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
|
@ -5,4 +5,12 @@
|
||||
<p><%= @user.name %></p>
|
||||
<p><%= mail_to(@user.email) %></p>
|
||||
<p><%= @user.role %></p>
|
||||
|
||||
<p>Quizzes:</p>
|
||||
<ul>
|
||||
<% @user.quizzes.each do |quiz| %>
|
||||
<li><%= quiz.name %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<%= link_to('Edit', admin_edit_user_path(@user.to_i), { class: 'btn' }) %>
|
||||
|
Loading…
Reference in New Issue
Block a user