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

Melahat Mindivanli #5

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass'
gem 'autoprefixer-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
Expand Down Expand Up @@ -36,4 +42,7 @@ end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require bootstrap-sprockets
//= require bootstrap-sprockets
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "bootstrap-sprockets";
@import "bootstrap";
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/
11 changes: 11 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class PagesController < ApplicationController
def anasayfa
@movies=Movie.all
end
def hakkimizda

end
def iletisim

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
5 changes: 5 additions & 0 deletions app/views/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<nav class="navbar navbar-inverse">
<%= link_to 'Anasayfa', anasayfa_path %>
<%= link_to 'Hakkımızda', hakkimizda_path %>
<%= link_to 'İletişim', iletisim_path %>
</nav>
7 changes: 7 additions & 0 deletions app/views/anasayfa.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h1>Anasayfa</h1>
<h4>List of Movies</h4>
<ul class="list-group">
<% @movies.each do |movie| %>
<li class="list-group-item"> <%= movie.title %> </li>
<% end %>
</ul>
1 change: 1 addition & 0 deletions app/views/hakkimizda.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h2>Hakkımızda</h2>
1 change: 1 addition & 0 deletions app/views/iletisim.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h2>İletişim</h2>
7 changes: 3 additions & 4 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Filmci</title>
<title>Movies</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

<%= render 'shared/navbar' %>
<%= yield %>
</body>
</html>
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Rails.application.routes.draw do
root "pages#anasayfa",as: :anasayfa
get "/hakkimizda",to:"pages#hakkimizda",as: :hakkimizda
get "/iletisim",to:"pages#iletisim",as: :iletisim
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

Expand Down
12 changes: 12 additions & 0 deletions db/20160313004727_add_movies_to_archive.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class AddMoviesToArchive < 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
Binary file added db/development.sqlite3
Binary file not shown.
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: 20160313004727) 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