This file contains hidden or 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
| # RewriteEngine On | |
| # RewriteCond %{REQUEST_FILENAME} !-f | |
| # RewriteRule ^([^\.]+)$ $1.html [NC,L] | |
| <ifModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.html$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d |
This file contains hidden or 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
| In Headers Tab add: | |
| KEY => Content-Type, | |
| VALUE => application/json | |
| In Body Tab and click "raw" | |
| example for adding objects: | |
| {"contact": {"first_name": "asdasd", "last_name": "yesyesyesy", "email": "wiiwwi"}} |
This file contains hidden or 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
| def index | |
| @metrics = Metric.search(params[:q]) | |
| end |
This file contains hidden or 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
| config.sign_out_via = [:get, :delete] |
This file contains hidden or 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
| # PostgreSQL. Versions 9.1 and up are supported. | |
| # | |
| # Install the pg driver: | |
| # gem install pg | |
| # On OS X with Homebrew: | |
| # gem install pg -- --with-pg-config=/usr/local/bin/pg_config | |
| # On OS X with MacPorts: | |
| # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
| # On Windows: | |
| # gem install pg |
This file contains hidden or 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
| <%= content_tag :div, | |
| id: "post-index", | |
| data: { | |
| posts: @posts.to_json(except: [:id, :created_at, :updated_at]) | |
| } do %> | |
| <h1> Posts </h1> | |
| <div v-for="post in posts"> | |
| <h2>{{post.tweet}}</h2> |
This file contains hidden or 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
| import Vue from 'vue/dist/vue.js' |
This file contains hidden or 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
| $ jekyll serve --host $IP --port $PORT --baseurl '' |
This file contains hidden or 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
| require 'rails_helper' | |
| RSpec.describe TweetsController, type: :controller do | |
| before(:example) do | |
| @user = create(:user) | |
| @tweet = create(:tweet, :user_id => @user) | |
| end | |
| it {should use_before_action :authenticate_user!} |