Skip to content
This repository was archived by the owner on Oct 31, 2020. It is now read-only.
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: 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 home
@posts = Blog.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/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>
4 changes: 4 additions & 0 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h1>Homepage</h1>
<p>Find me in app/views/pages/home.html.erb</p>

<%= @posts.inspect%>
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
get 'pages/home'
get 'pages/about'
get 'pages/contact'
resources :blogs
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end