Commit 3baa7d36 by tady

set meta-tags

parent 71fbb91a
...@@ -163,3 +163,5 @@ gem 'rails_12factor', group: :production ...@@ -163,3 +163,5 @@ gem 'rails_12factor', group: :production
# for IP restriction # for IP restriction
gem 'rack-contrib', require: 'rack/contrib' gem 'rack-contrib', require: 'rack/contrib'
gem 'meta-tags'
...@@ -235,6 +235,8 @@ GEM ...@@ -235,6 +235,8 @@ GEM
nokogiri (~> 1.4) nokogiri (~> 1.4)
ntlm-http (~> 0.1, >= 0.1.1) ntlm-http (~> 0.1, >= 0.1.1)
webrobots (>= 0.0.9, < 0.2) webrobots (>= 0.0.9, < 0.2)
meta-tags (2.0.0)
actionpack (>= 3.0.0)
method_source (0.8.2) method_source (0.8.2)
mime-types (2.4.3) mime-types (2.4.3)
mini_portile (0.6.1) mini_portile (0.6.1)
...@@ -491,6 +493,7 @@ DEPENDENCIES ...@@ -491,6 +493,7 @@ DEPENDENCIES
kaminari! kaminari!
launchy launchy
mail mail
meta-tags
mysql2 mysql2
newrelic_rpm newrelic_rpm
nokogiri nokogiri
......
...@@ -8,6 +8,8 @@ class PostsController < ApplicationController ...@@ -8,6 +8,8 @@ class PostsController < ApplicationController
# GET /posts/1 # GET /posts/1
# GET /posts/1.json # GET /posts/1.json
def show def show
set_meta_tags title: @post.title
current_user.visit_post!(@post) current_user.visit_post!(@post)
@post.tags.each do |tag| @post.tags.each do |tag|
...@@ -18,6 +20,8 @@ class PostsController < ApplicationController ...@@ -18,6 +20,8 @@ class PostsController < ApplicationController
# GET /posts/new # GET /posts/new
def new def new
set_meta_tags title: '新しい投稿'
@post = Post.new(title: '新しい投稿') @post = Post.new(title: '新しい投稿')
render layout: 'edit' render layout: 'edit'
end end
...@@ -44,6 +48,8 @@ class PostsController < ApplicationController ...@@ -44,6 +48,8 @@ class PostsController < ApplicationController
# GET /posts/1/edit # GET /posts/1/edit
def edit def edit
set_meta_tags title: @post.title
render layout: 'edit' render layout: 'edit'
end end
......
...@@ -2,7 +2,7 @@ doctype html ...@@ -2,7 +2,7 @@ doctype html
= render partial: 'partials/rendezvous' = render partial: 'partials/rendezvous'
html lang="ja" html lang="ja"
head head
title Rendezvous = display_meta_tags site: 'Rendezvous', reverse: true
meta content="width=device-width, initial-scale=1.0" name="viewport" / meta content="width=device-width, initial-scale=1.0" name="viewport" /
link href="//netdna.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" / link href="//netdna.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" /
link href="//netdna.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css" rel="stylesheet" / link href="//netdna.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css" rel="stylesheet" /
......
...@@ -2,7 +2,7 @@ doctype html ...@@ -2,7 +2,7 @@ doctype html
= render partial: 'partials/rendezvous' = render partial: 'partials/rendezvous'
html lang="ja" html lang="ja"
head head
title Rendezvous = display_meta_tags site: 'Rendezvous', reverse: true
meta content="width=device-width, initial-scale=1.0" name="viewport" / meta content="width=device-width, initial-scale=1.0" name="viewport" /
link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" / link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" /
link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" rel="stylesheet" / link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" rel="stylesheet" /
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ja"> <html lang="ja">
<head> <head>
<title>Rendezvous</title> <%= display_meta_tags :site => 'Rendezvous', reverse: true %>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head> </head>
<body class="rails-<%= params[:controller] %>-<%= params[:action] %>"> <body class="rails-<%= params[:controller] %>-<%= params[:action] %>">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment