mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
working on question_lists
This commit is contained in:
parent
d731049fc6
commit
cc84c3bbda
26 changed files with 498 additions and 10 deletions
20
app/views/question_lists/_form.html.haml
Normal file
20
app/views/question_lists/_form.html.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
= form_for(question_list) do |f|
|
||||
- if question_list.errors.any?
|
||||
#error_explanation
|
||||
%h2
|
||||
= pluralize(question_list.errors.count, "error")
|
||||
prohibited this question_list from being saved:
|
||||
%ul
|
||||
- question_list.errors.full_messages.each do |message|
|
||||
%li= message
|
||||
.field
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
.field
|
||||
= f.label :description
|
||||
= f.text_area :description
|
||||
.field
|
||||
= f.label :question_ids
|
||||
= f.text_area :question_ids
|
||||
.actions
|
||||
= f.submit
|
||||
5
app/views/question_lists/edit.html.haml
Normal file
5
app/views/question_lists/edit.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%h1 Editing Question List
|
||||
= render 'form', question_list: @question_list
|
||||
= link_to 'Show', @question_list
|
||||
|
|
||||
= link_to 'Back', question_lists_path
|
||||
20
app/views/question_lists/index.html.haml
Normal file
20
app/views/question_lists/index.html.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
%p#notice= notice
|
||||
%h1 Question Lists
|
||||
%table
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Description
|
||||
%th Question ids
|
||||
%th{:colspan => "3"}
|
||||
%tbody
|
||||
- @question_lists.each do |question_list|
|
||||
%tr
|
||||
%td= question_list.name
|
||||
%td= question_list.description
|
||||
%td= question_list.question_ids
|
||||
%td= link_to 'Show', question_list
|
||||
%td= link_to 'Edit', edit_question_list_path(question_list)
|
||||
%td= link_to 'Destroy', question_list, method: :delete, data: { confirm: 'Are you sure?' }
|
||||
%br/
|
||||
= link_to 'New Question List', new_question_list_path
|
||||
4
app/views/question_lists/index.json.jbuilder
Normal file
4
app/views/question_lists/index.json.jbuilder
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
json.array!(@question_lists) do |question_list|
|
||||
json.extract! question_list, :id, :name, :description, :question_ids
|
||||
json.url question_list_url(question_list, format: :json)
|
||||
end
|
||||
3
app/views/question_lists/new.html.haml
Normal file
3
app/views/question_lists/new.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
%h1 New Question List
|
||||
= render 'form', question_list: @question_list
|
||||
= link_to 'Back', question_lists_path
|
||||
13
app/views/question_lists/show.html.haml
Normal file
13
app/views/question_lists/show.html.haml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
%p#notice= notice
|
||||
%p
|
||||
%strong Name:
|
||||
= @question_list.name
|
||||
%p
|
||||
%strong Description:
|
||||
= @question_list.description
|
||||
%p
|
||||
%strong Question ids:
|
||||
= @question_list.question_ids
|
||||
= link_to 'Edit', edit_question_list_path(@question_list)
|
||||
|
|
||||
= link_to 'Back', question_lists_path
|
||||
1
app/views/question_lists/show.json.jbuilder
Normal file
1
app/views/question_lists/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.extract! @question_list, :id, :name, :description, :question_ids, :created_at, :updated_at
|
||||
Loading…
Add table
Add a link
Reference in a new issue