Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Furkan Çelik (Ödev 2 ) #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,3 @@ DEPENDENCIES
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)

BUNDLED WITH
1.11.2
2 changes: 2 additions & 0 deletions app/assets/javascripts/pages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
3 changes: 3 additions & 0 deletions app/assets/stylesheets/pages.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
12 changes: 12 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class PagesController < ApplicationController

def home_page
@movies = Movie.all
end

def about
end

def contact
end
end
2 changes: 2 additions & 0 deletions app/helpers/pages_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module PagesHelper
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", anasayfa_path ) %> |
<%= link_to("Hakkinda", hakkinda_path ) %> |
<%= link_to("İletişim", iletisim_path ) %>

<%= yield %>

</body>
Expand Down
2 changes: 2 additions & 0 deletions app/views/pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Pages#about</h1>
<p>Find me in app/views/pages/about.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/pages/contact.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Pages#contact</h1>
<p>Find me in app/views/pages/contact.html.erb</p>
8 changes: 8 additions & 0 deletions app/views/pages/home_page.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>

6 changes: 6 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
Rails.application.routes.draw do
get 'anasayfa'=>'pages#home_page'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uygulamanda root path yok. Yani localhost:3000 diye girdigin zaman acilacak sayfayi ayarlamamissin

get 'hakkinda'=>'pages#about'

get 'iletisim'=>'pages#contact'

# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

Expand Down
13 changes: 13 additions & 0 deletions db/migrate/20160315174851_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: 20160315174851) 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