Refactor admin/call_for_booth controller

This commit is contained in:
nasia 2017-06-10 23:50:31 +03:00
parent 9103f511a7
commit 318c0d15a4
17 changed files with 182 additions and 18 deletions

View file

@ -0,0 +1,28 @@
= form_for @booth do |f|
- if @booth.errors.any?
#error_explanation
%h2= "#{pluralize(@booth.errors.count, "error")} prohibited this booth from being saved:"
%ul
- @booth.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :title
= f.text_field :title
.field
= f.label :conference_id
= f.number_field :conference_id
.field
= f.label :description
= f.text_area :description
.field
= f.label :state
= f.text_field :state
.field
= f.label :reasoning
= f.text_area :reasoning
.field
= f.label :logo_link
= f.text_field :logo_link
.actions
= f.submit 'Save'

View file

@ -0,0 +1,7 @@
%h1 Editing booth
= render 'form'
= link_to 'Show', @booth
\|
= link_to 'Back', booths_path

View file

@ -0,0 +1,29 @@
%h1 Listing booths
%table
%tr
%th Title
%th Conference
%th Description
%th State
%th Reasoning
%th Logo link
%th
%th
%th
- @booths.each do |booth|
%tr
%td= booth.title
%td= booth.conference_id
%td= booth.description
%td= booth.state
%td= booth.reasoning
%td= booth.logo_link
%td= link_to 'Show', booth
%td= link_to 'Edit', edit_booth_path(booth)
%td= link_to 'Destroy', booth, :method => :delete, :data => { :confirm => 'Are you sure?' }
%br
= link_to 'New Booth', new_admin_conference_booth_path

View file

@ -0,0 +1,5 @@
%h1 New booth
= render 'form'
= link_to 'Back', booths_path

View file

@ -0,0 +1,24 @@
%p#notice= notice
%p
%b Title:
= @booth.title
%p
%b Conference:
= @booth.conference_id
%p
%b Description:
= @booth.description
%p
%b State:
= @booth.state
%p
%b Reasoning:
= @booth.reasoning
%p
%b Logo link:
= @booth.logo_link
= link_to 'Edit', edit_booth_path(@booth)
\|
= link_to 'Back', booths_path