diff --git a/app/assets/javascripts/store.coffee b/app/assets/javascripts/store.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/store.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/store.scss b/app/assets/stylesheets/store.scss new file mode 100644 index 0000000..42f062a --- /dev/null +++ b/app/assets/stylesheets/store.scss @@ -0,0 +1,48 @@ +// Place all the styles related to the Store controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + +.store { + h1 { + margin: 0; + padding-bottom: 0.5em; + font: 150% sans-serif; + color: #226; + border-bottom: 3px dotted #77d; + } + + .entry { + overflow: auto; + margin-top: 1em; + border-bottom: 1px dotted #77d; + min-height: 100px; + + img { + width: 80px; + margin-right: 5px; + margin-bottom: 5px; + position: absolute; + } + + h3 { + font-size: 120%; + font-family: sans-serif; + margin-left: 100px; + margin-top: 0; + margin-bottom: 2px; + color: #227 + } + + p, div.price_line { + margin-left: 100px; + margin-top: 0.5em; + margin-bottom: 0.8em; + } + + .price { + color: #44a; + font-weight: bold; + margin-right: 3em; + } + } +} diff --git a/app/controllers/store_controller.rb b/app/controllers/store_controller.rb new file mode 100644 index 0000000..9a52290 --- /dev/null +++ b/app/controllers/store_controller.rb @@ -0,0 +1,5 @@ +class StoreController < ApplicationController + def index + @products = Product.order(:title) + end +end diff --git a/app/helpers/store_helper.rb b/app/helpers/store_helper.rb new file mode 100644 index 0000000..9263619 --- /dev/null +++ b/app/helpers/store_helper.rb @@ -0,0 +1,2 @@ +module StoreHelper +end diff --git a/app/views/store/index.html.erb b/app/views/store/index.html.erb new file mode 100644 index 0000000..3d97992 --- /dev/null +++ b/app/views/store/index.html.erb @@ -0,0 +1,14 @@ +
<%= notice %>
+ +