This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<title><%= title %></title> | |
<link rel='stylesheet' href='/css/stylesheet.css' /> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css"> | |
<script src="../../assets/js/html5shiv.js"></script> | |
<script src="../../assets/js/respond.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Contoh Baris dan Kolom --> | |
<div class="row"> | |
<div class="col-md-4"> | |
<h2>Heading</h2> | |
<p>Donec id elit non mi porta gravida at eget metus. Fusce | |
dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut | |
fermentum massa justo sit amet risus. Etiam porta sem malesuada magna | |
mollis euismod. Donec sed odio dui.</p> | |
<p> | |
<a class="btn btn-default" href="#" role="button">View details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var about = require('./routes/about'); | |
app.get('/about', about.about); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.about = function(req, res){ | |
res.render('about', { title: 'Express' }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<% include header %> | |
<body> | |
<% include navbar %> | |
<div class="container"> | |
<div class="page-header"> | |
<h1> | |
About <small>What we aim for!</small> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1> Selamat datang di Rizkylab </h1> | |
<% @posts.each do |post| %> | |
<h2> <%= link_to post.judul, post %> </h2> | |
<p> | |
<%= time_ago_in_words post.created_at %> ago | |
</p> | |
<p> | |
<%= truncate post.test %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p id="notice"><%= notice %></p> | |
<p> | |
<strong>Judul:</strong> | |
<%= @post.judul %> | |
</p> | |
<p> | |
<strong>Isi:</strong> | |
<%= @post.test %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommentsController < ApplicationController | |
def create | |
@post = Post.find(params[:post_id]) | |
@comment = @post.comments.create(params[:comments]) | |
@comment.save | |
redirect_to post_path(@post) | |
end | |
def destroy |
OlderNewer