Sha256: 81e5966bf8e66beaa5ed04456f056c595648452b3416762261618248b20994fe

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

class CreateKuztuscmsLayouts < ActiveRecord::Migration
  def change
    create_table :kuztuscms_layouts do |t|
      t.text :body
      t.string :path
      t.string :format
      t.string :locale
      t.string :handler
      t.boolean :partial, :default => false

      t.timestamps
    end

    body = <<EOF
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="keywords" content="<%= @page.keywords %>" />
  <meta name="description" content="<%= @page.description %>" />
  <title><%= @page.title %></title>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body>
  <%= render 'google-analytics' %>
  <p class=notice><%= notice %></p>
  <p class=alert><%= alert %></p>
  <%= yield %>
</body>
</html>
EOF
    Kuztuscms::Layout.create(
      :body => body, 
      :path => 'default', 
      :format => 'html', 
      :locale => 'en', 
      :handler => 'erb', 
      :partial => false
    )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuztuscms-0.0.6 db/migrate/20120311173954_create_kuztuscms_layouts.rb
kuztuscms-0.0.5 db/migrate/20120311173954_create_kuztuscms_layouts.rb
kuztuscms-0.0.4 db/migrate/20120311173954_create_kuztuscms_layouts.rb
kuztuscms-0.0.3 db/migrate/20120311173954_create_kuztuscms_layouts.rb
kuztuscms-0.0.2 db/migrate/20120311173954_create_kuztuscms_layouts.rb
kuztuscms-0.0.1 db/migrate/20120311173954_create_kuztuscms_layouts.rb