Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions app/assets/stylesheets/scaffolds.css.scss
Original file line number Diff line number Diff line change
@@ -1,56 +0,0 @@
body {
background-color: #fff;
color: #333;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px; }

p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px; }

pre {
background-color: #eee;
padding: 10px;
font-size: 11px; }

a {
color: #000;
&:visited {
color: #666; }
&:hover {
color: #fff;
background-color: #000; } }

div {
&.field, &.actions {
margin-bottom: 10px; } }

#notice {
color: green; }

.field_with_errors {
padding: 2px;
background-color: red;
display: table; }

#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px;
padding-bottom: 0;
margin-bottom: 20px;
background-color: #f0f0f0;
h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
margin-bottom: 0px;
background-color: #c00;
color: #fff; }
ul li {
font-size: 12px;
list-style: square; } }
3 changes: 0 additions & 3 deletions app/controllers/questions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
class QuestionsController < InheritedController

defaults :resource_class => Question

end
1 change: 1 addition & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
%html
%head
%title Hackety Hack!
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-1.1.1.min.css">
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
Expand Down
11 changes: 6 additions & 5 deletions app/views/questions/_list.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%li.item
= link_to list, resource_path(list)

%tr.item
%td= list.title
%td= list.description
%td= link_to "Show", resource_path(list)
- if can? :update, list
= link_to 'Edit', edit_resource_path(list)
%td= link_to 'Edit', edit_resource_path(list)
- if can? :destroy, list
= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete
%td= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete
10 changes: 9 additions & 1 deletion app/views/questions/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
- if can? :create, Question
= link_to "New question", new_resource_path

%ol
%table
%thead
%th Title
%th Description

%th
%th
%th

= render :partial => "list", :collection => collection
12 changes: 7 additions & 5 deletions lib/generators/haml/scaffold/templates/_list.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
%li.item
= link_to list, resource_path(list)

%tr.item
<% for attribute in attributes -%>
%td= list.<%= attribute.name %>
<% end -%>
%td= link_to "Show", resource_path(list)
- if can? :update, list
= link_to 'Edit', edit_resource_path(list)
%td= link_to 'Edit', edit_resource_path(list)
- if can? :destroy, list
= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete
%td= link_to 'Delete', resource_path(list), :confirm => 'Are you sure?', :method => :delete
10 changes: 9 additions & 1 deletion lib/generators/haml/scaffold/templates/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
- if can? :create, <%= singular_table_name.classify %>
= link_to "New <%= singular_table_name %>", new_resource_path

%ol
%table
%thead
<% for attribute in attributes -%>
%th <%= attribute.human_name %>
<% end -%>
%th
%th
%th

= render :partial => "list", :collection => collection