From 9d574f551109908fb022a38ae84d83d497a52623 Mon Sep 17 00:00:00 2001 From: Florian Bogenhard Date: Fri, 8 Aug 2014 22:56:13 +0200 Subject: [PATCH] =?UTF-8?q?f=C3=BCgt=20eine=20navbar=20und=20eine=20Indexs?= =?UTF-8?q?eite=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/documents_controller.rb | 2 ++ app/models/document.rb | 2 ++ app/views/documents/index.html.slim | 1 + app/views/layouts/application.html.erb | 14 ---------- app/views/layouts/application.html.slim | 22 +++++++++++++++ config/routes.rb | 3 ++ db/migrate/20140808200903_create_documents.rb | 9 ++++++ db/schema.rb | 28 +++++++++++++++++++ 8 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 app/controllers/documents_controller.rb create mode 100644 app/models/document.rb create mode 100644 app/views/documents/index.html.slim delete mode 100644 app/views/layouts/application.html.erb create mode 100644 app/views/layouts/application.html.slim create mode 100644 db/migrate/20140808200903_create_documents.rb create mode 100644 db/schema.rb diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb new file mode 100644 index 0000000..37636e7 --- /dev/null +++ b/app/controllers/documents_controller.rb @@ -0,0 +1,2 @@ +class DocumentsController < ApplicationController +end diff --git a/app/models/document.rb b/app/models/document.rb new file mode 100644 index 0000000..46a330f --- /dev/null +++ b/app/models/document.rb @@ -0,0 +1,2 @@ +class Document < ActiveRecord::Base +end diff --git a/app/views/documents/index.html.slim b/app/views/documents/index.html.slim new file mode 100644 index 0000000..6c4a5ac --- /dev/null +++ b/app/views/documents/index.html.slim @@ -0,0 +1 @@ +| Hallo \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index 436b59d..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - Klaus - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim new file mode 100644 index 0000000..0c8f2d2 --- /dev/null +++ b/app/views/layouts/application.html.slim @@ -0,0 +1,22 @@ +doctype html +html + head + title + | Klausurverwaltung + = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true + = javascript_include_tag 'application', 'data-turbolinks-track' => true + = csrf_meta_tags + body + nav.navbar.navbar-default role="navigation" + div.container-fluid + div.navbar-header + button.navbar-toggle type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" + spansr-only Toggle navigation + spanicon-bar + spanicon-bar + spanicon-bar + = link_to 'Klaus', root_path, class: 'navbar-brand' + div.collapse.navbar-collapse#bs-example-navbar-collapse-1 + div.row + div.col-md-12 + = yield \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3f66539..4cdc3a1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,7 @@ Rails.application.routes.draw do + resources :documents + + root 'documents#index' # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/db/migrate/20140808200903_create_documents.rb b/db/migrate/20140808200903_create_documents.rb new file mode 100644 index 0000000..7f47dc6 --- /dev/null +++ b/db/migrate/20140808200903_create_documents.rb @@ -0,0 +1,9 @@ +class CreateDocuments < ActiveRecord::Migration + def change + create_table :documents do |t| + t.string :name + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..73f5955 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,28 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20140808200903) do + + create_table "doc_types", force: true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "documents", force: true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + +end