Refactor admin/call_for_booth controller
This commit is contained in:
parent
9103f511a7
commit
318c0d15a4
17 changed files with 182 additions and 18 deletions
19
app/views/admin/call_for_booths/_form.html.haml
Normal file
19
app/views/admin/call_for_booths/_form.html.haml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
= form_for @call_for_booth do |f|
|
||||
- if @call_for_booth.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@call_for_booth.errors.count, "error")} prohibited this call_for_booth from being saved:"
|
||||
%ul
|
||||
- @call_for_booth.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.field
|
||||
= f.label :start_date
|
||||
= f.date_select :start_date
|
||||
.field
|
||||
= f.label :end_date
|
||||
= f.date_select :end_date
|
||||
.field
|
||||
= f.label :booth_limit
|
||||
= f.number_field :booth_limit
|
||||
.actions
|
||||
= f.submit 'Save'
|
||||
7
app/views/admin/call_for_booths/edit.html.haml
Normal file
7
app/views/admin/call_for_booths/edit.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
%h1 Editing call_for_booth
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Show', @call_for_booth
|
||||
\|
|
||||
= link_to 'Back', call_for_booths_path
|
||||
23
app/views/admin/call_for_booths/index.html.haml
Normal file
23
app/views/admin/call_for_booths/index.html.haml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
%h1 Listing call_for_booths
|
||||
|
||||
%table
|
||||
%tr
|
||||
%th Start date
|
||||
%th End date
|
||||
%th Booth limit
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
|
||||
- @call_for_booths.each do |call_for_booth|
|
||||
%tr
|
||||
%td= call_for_booth.start_date
|
||||
%td= call_for_booth.end_date
|
||||
%td= call_for_booth.booth_limit
|
||||
%td= link_to 'Show', call_for_booth
|
||||
%td= link_to 'Edit', edit_call_for_booth_path(call_for_booth)
|
||||
%td= link_to 'Destroy', call_for_booth, :method => :delete, :data => { :confirm => 'Are you sure?' }
|
||||
|
||||
%br
|
||||
|
||||
= link_to 'New Call for booth', new_call_for_booth_path
|
||||
5
app/views/admin/call_for_booths/new.html.haml
Normal file
5
app/views/admin/call_for_booths/new.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%h1 New call_for_booth
|
||||
|
||||
= render 'form'
|
||||
|
||||
= link_to 'Back', call_for_booths_path
|
||||
15
app/views/admin/call_for_booths/show.html.haml
Normal file
15
app/views/admin/call_for_booths/show.html.haml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
%p#notice= notice
|
||||
|
||||
%p
|
||||
%b Start date:
|
||||
= @call_for_booth.start_date
|
||||
%p
|
||||
%b End date:
|
||||
= @call_for_booth.end_date
|
||||
%p
|
||||
%b Booth limit:
|
||||
= @call_for_booth.booth_limit
|
||||
|
||||
= link_to 'Edit', edit_call_for_booth_path(@call_for_booth)
|
||||
\|
|
||||
= link_to 'Back', call_for_booths_path
|
||||
Loading…
Add table
Add a link
Reference in a new issue