Skip to content

Commit 27b9415

Browse files
committed
#2 Use Hierapolis forms
1 parent cbe62e9 commit 27b9415

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
= form_for @static_page do |f|
2-
.field
3-
= f.label :title
4-
%br
5-
= f.text_field :title
1+
.panel.panel-default
2+
.panel-heading
3+
%i.icon-edit.icon-large
4+
Form
5+
.panel-body
66

7-
.field
8-
= f.label :content
9-
%br
10-
= f.text_field :content
7+
=form_for @static_page do |f|
8+
.form-group
9+
= f.label :title, class: 'label control-label'
10+
= f.text_field :title, class: 'input form-control', placeholder: 'Page title'
1111

12-
.actions
13-
= f.submit
12+
.form-group
13+
= f.label :content, class: 'label control-label'
14+
= f.text_area :content, class: 'textarea form-control', placeholder: 'Content', rows: 4
15+
16+
.form-actions
17+
%button.btn.btn-default{type: 'submit'} Submit
18+
%a.btn{href: static_pages_path} Cancel

app/views/kebapage/static_pages/index.html.haml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
=stylesheet_link_tag 'stylesheets/application'
2-
31
.panel.panel-default.grid
42
.panel-heading
53
%i.icon-table.icon-large
@@ -17,11 +15,11 @@
1715
- @static_pages.each do |static_page|
1816
%tr
1917
%td
20-
= static_page.id
18+
= (@static_pages.index static_page) + 1
2119
%td
2220
= static_page.title
2321
%td
24-
= static_page.content
22+
= truncate static_page.content, length: 25
2523
%td.action
2624
%a.btn.btn-success{href: static_page_path(static_page), data: { toggle: 'tooltip'}, title: 'Zoom'}
2725
%i.icon-zoom-in
@@ -30,4 +28,4 @@
3028
= link_to static_page_path(static_page), method: :delete, data: { confirm: 'Are you sure?'}, class: 'btn btn-danger' do
3129
%i.icon-trash
3230

33-
= link_to 'New Static Page', new_static_page_path
31+
= link_to 'New Static Page', new_static_page_path, method: :get, class: 'btn btn-default'

0 commit comments

Comments
 (0)