diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss index 05188f08..e69de29b 100644 --- a/app/assets/stylesheets/scaffolds.css.scss +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -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; } } diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index 5a022b6a..a426db50 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -1,5 +1,2 @@ class QuestionsController < InheritedController - - defaults :resource_class => Question - end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e96860bb..8c8a0e2c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,6 +2,7 @@ %html %head %title Hackety Hack! + = stylesheet_link_tag "application" = javascript_include_tag "application" = csrf_meta_tags diff --git a/app/views/questions/_list.html.haml b/app/views/questions/_list.html.haml index 56e80a75..4ccb8f4e 100644 --- a/app/views/questions/_list.html.haml +++ b/app/views/questions/_list.html.haml @@ -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 diff --git a/app/views/questions/index.html.haml b/app/views/questions/index.html.haml index 3c926320..b0dba357 100644 --- a/app/views/questions/index.html.haml +++ b/app/views/questions/index.html.haml @@ -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 \ No newline at end of file diff --git a/lib/generators/haml/scaffold/templates/_list.html.haml b/lib/generators/haml/scaffold/templates/_list.html.haml index 56e80a75..98dc46f8 100644 --- a/lib/generators/haml/scaffold/templates/_list.html.haml +++ b/lib/generators/haml/scaffold/templates/_list.html.haml @@ -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 diff --git a/lib/generators/haml/scaffold/templates/index.html.haml b/lib/generators/haml/scaffold/templates/index.html.haml index 9ab16293..1bbaf954 100644 --- a/lib/generators/haml/scaffold/templates/index.html.haml +++ b/lib/generators/haml/scaffold/templates/index.html.haml @@ -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 \ No newline at end of file