For HTTP headers it's quite straightforward: draft-nottingham-http-link-header defines this.
Link: <http://example.com/>; rel="previous"; titile="Previous chapter"
| # db/migrate/20131118172653_create_transactional_items_view.rb | |
| class CreateTransactionalItemsView < ActiveRecord::Migration | |
| def up | |
| select_sql = File.open("#{Rails.root}/db/migrate/20131118172653_create_transactional_items_view.sql", 'r') { |f| f.read } | |
| # for materialized view: | |
| view_sql = "CREATE MATERIALIZED VIEW transactional_items AS (#{select_sql})" | |
| # for normal view: | |
| view_sql = "CREATE VIEW transactional_items AS (#{select_sql})" | |
For HTTP headers it's quite straightforward: draft-nottingham-http-link-header defines this.
Link: <http://example.com/>; rel="previous"; titile="Previous chapter"
| References: | |
| http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/ | |
| https://github.com/cyu/rack-cors | |
| http://nelm.io/blog/2011/11/cors-with-sencha-touch/ | |
| http://jessehowarth.com/2011/04/27/ajax-login-with-devise | |
| ============================================================================================================= | |
| GEMFILE | |
| ============================================================================================================= | |
| gem 'rack-cors', :require => 'rack/cors' |
| # config/locales/en.yml | |
| en: | |
| exception: | |
| show: | |
| not_found: | |
| title: "Not Found" | |
| description: "The page you were looking for does not exists." | |
| internal_server_error: | |
| title: "Internal Server Error" |
| #!/usr/bin/env ruby | |
| # Libraries::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
| require 'rubygems' | |
| require 'sinatra/base' | |
| require 'slim' | |
| require 'sass' | |
| require 'coffee-script' | |
| # Application::::::::::::::::::::::::::::::::::::::::::::::::::: |
| # config/locales/en.yml | |
| en: | |
| exception: | |
| show: | |
| not_found: | |
| title: "Not Found" | |
| description: "The page you were looking for does not exists." | |
| internal_server_error: | |
| title: "Internal Server Error" |