AutoCommit Mit Aug 5 09:03:03 CEST 2015
This commit is contained in:
@@ -4,7 +4,7 @@ class Survey::Question < ActiveRecord::Base
|
|||||||
has_many :choices, dependent: :destroy
|
has_many :choices, dependent: :destroy
|
||||||
has_many :answers, through: :choices
|
has_many :answers, through: :choices
|
||||||
include IsCommentable
|
include IsCommentable
|
||||||
|
FLAG_ICONS={"delete" => "fa fa-trash"}
|
||||||
scope :templates, ->{ where(flag_template:true)}
|
scope :templates, ->{ where(flag_template:true)}
|
||||||
|
|
||||||
def add_yesno_choices
|
def add_yesno_choices
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<div class="contentbox" id ="<%= divid_for(question) %>" style="">
|
<div class="contentbox" id ="<%= divid_for(question) %>" style="">
|
||||||
<div >
|
<div >
|
||||||
<b><%= question.title%></b> <%=question.text%><%= link_to fa_icon("pencil"), edit_survey_question_path(question) , class: "btn btn-link navbar-btn" , remote: true%>
|
<b><%= question.title%></b> <%=question.text%><%= link_to fa_icon("pencil"), edit_survey_question_path(question) , class: "btn btn-link navbar-btn" , remote: true%>
|
||||||
|
<%= flag_link(question, "delete")%>
|
||||||
|
|
||||||
<ul class="choice-list">
|
<ul class="choice-list">
|
||||||
<% question.choices.each do |c| %>
|
<% question.choices.each do |c| %>
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
member do
|
member do
|
||||||
get :answer
|
get :answer
|
||||||
put :answer
|
put :answer
|
||||||
|
get 'flag'
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :choices
|
resources :choices
|
||||||
|
|||||||
Reference in New Issue
Block a user