Skip to content

Commit

Permalink
Bootstrap codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
beydogan committed Mar 19, 2016
1 parent 0f0e1b6 commit 1e62703
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 53 deletions.
13 changes: 13 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class PagesController < ApplicationController
def home
@movies = Movie.all
end

def about

end

def contact

end
end
2 changes: 2 additions & 0 deletions app/models/movie.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Movie < ActiveRecord::Base
end
4 changes: 4 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
</head>
<body>

<%= link_to "Anasayfa", root_path %> | <%= link_to "Hakkkında", about_path %> | <%= link_to "İletişim", contact_path %>

<br />

<%= yield %>

</body>
Expand Down
1 change: 1 addition & 0 deletions app/views/pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hakkında Sayfası</h1>
1 change: 1 addition & 0 deletions app/views/pages/contact.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>İletişim Sayfası</h1>
8 changes: 8 additions & 0 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h1>Anasayfa</h1>

<h4>Film Listesi</h4>
<ul>
<% @movies.each do |movie| %>
<li> <%= movie.title %> </li>
<% end %>
</ul>
56 changes: 3 additions & 53 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,56 +1,6 @@
Rails.application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
root to: "pages#home"
get 'hakkinda', to: "about", as: :about
get 'iletisim', to: "contact", as: :contact

# You can have the root of your site routed with "root"
# root 'welcome#index'

# Example of regular route:
# get 'products/:id' => 'catalog#view'

# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products

# Example resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end

# Example resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end

# Example resource route with more complex sub-resources:
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', on: :collection
# end
# end

# Example resource route with concerns:
# concern :toggleable do
# post 'toggle'
# end
# resources :posts, concerns: :toggleable
# resources :photos, concerns: :toggleable

# Example resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
end
13 changes: 13 additions & 0 deletions db/migrate/20160319164245_create_movies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateMovies < ActiveRecord::Migration
def change
create_table :movies do |t|
t.string :title
t.text :description
t.string :director
t.string :country
t.integer :date

t.timestamps null: false
end
end
end
26 changes: 26 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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: 20160319164245) do

create_table "movies", force: :cascade do |t|
t.string "title"
t.text "description"
t.string "director"
t.string "country"
t.integer "date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end

0 comments on commit 1e62703

Please sign in to comment.