forked from apotonick/gemgem-sinatra
-
Notifications
You must be signed in to change notification settings - Fork 6
/
new.slim
61 lines (45 loc) · 2.07 KB
/
new.slim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.row
.col-sm-6.col-sm-offset-3
.page-header.text-center
h1 New Post!
= vertical_form(model.contract, url) do |f|
.row
.col-sm-6
= f.input_group :title, label: "Title" do |input|
=input.group_addon('<input type="checkbox" value="1"/>')
=input.control
.col-sm-6
= f.input :url_slug, label: "URL Slug"
= f.input_group :url_slug, label: "URL", left_addon: 'http://', right_addon: '.com'
= f.select :select_roles, label: "Roles", collection: roles_array, prompt: 'Choose a role'
= f.inline_radio :select_roles, label: "Inline radios", collection: [[1, "Yes"], [2, "No"], [3, "I really don't know"]]
= f.inline_checkbox :select_roles, label: "Inline checkboxes", collection: options_array
hr
h4 Checkboxes in columns!
.row
.col-sm-4
= f.checkbox :select_roles, label: "Column 1", collection: options_array
.col-sm-4
= f.checkbox :select_roles, label: "Column 2", collection: options_array
.col-sm-4
= f.checkbox :select_roles, label: "Column 3", collection: options_array
hr
= f.textarea :content, placeholder: "And your story...", rows: 9
= f.checkbox :is_public, label: "Public?", value: "1"
= f.submit content: "Submit!", class: ['btn-lg']
.page-header.text-center
h1 Inline Form
= inline_form(model.contract, url) do |f|
= f.input :title
= f.input :url_slug, label: 'url slug', placeholder: "URL slug", label_options: { class: ["sr-only"] }
=f.submit(content: "Submit!")
.page-header.text-center
h1 Horizontal Form
= horizontal_form(model.contract, url) do |f|
= f.input_group :title, label: "Title" do |input|
=input.control
=input.group_btn("<a class='btn btn-default' href='#'>Suprise Me</a>")
= f.input :url_slug, label: 'URL'
= f.textarea :content, placeholder: "And your story...", rows: 9, label: 'Content'
= f.select :select_roles, collection: roles_array, label: 'Role', prompt: 'Choose a role'
= f.submit content: "Submit!", class: ['btn-lg']