mailboxer 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/.travis.yml +4 -2
- data/Gemfile +2 -2
- data/README.md +239 -0
- data/Rakefile +1 -21
- data/app/models/message.rb +3 -0
- data/app/models/receipt.rb +12 -0
- data/app/uploaders/attachment_uploader.rb +3 -0
- data/lib/generators/mailboxer/install_generator.rb +20 -12
- data/lib/generators/mailboxer/templates/add_attachments.rb +13 -0
- data/{db/migrate/20110912163911_add_notification_code.rb → lib/generators/mailboxer/templates/add_notification_code.rb} +0 -0
- data/{db/migrate/20110719110700_add_notified_object.rb → lib/generators/mailboxer/templates/add_notified_object.rb} +0 -0
- data/{db/migrate/20110511145103_create_mailboxer.rb → lib/generators/mailboxer/templates/create_mailboxer.rb} +0 -0
- data/lib/generators/mailboxer/templates/initializer.rb +8 -3
- data/lib/generators/mailboxer/views_generator.rb +9 -0
- data/lib/mailboxer.rb +7 -1
- data/lib/mailboxer/engine.rb +2 -0
- data/lib/mailboxer/models/messageable.rb +21 -12
- data/mailboxer.gemspec +39 -34
- data/spec/dummy/.gitignore +4 -0
- data/spec/dummy/Gemfile +28 -2
- data/spec/dummy/app/controllers/home_controller.rb +4 -0
- data/spec/dummy/{public/stylesheets → app/mailers}/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/cylon.rb +1 -0
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/app/views/home/index.html.haml +7 -0
- data/spec/dummy/app/views/layouts/application.html.haml +11 -0
- data/spec/dummy/config/application.rb +3 -6
- data/spec/dummy/config/database.yml +5 -3
- data/spec/dummy/config/environments/development.rb +1 -1
- data/spec/dummy/config/environments/production.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/dummy/config/initializers/mailboxer.rb +7 -2
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -1
- data/spec/dummy/config/locales/en.yml +1 -1
- data/spec/dummy/config/routes.rb +1 -3
- data/spec/dummy/config/sunspot.yml +17 -0
- data/spec/dummy/db/migrate/{20110719111119_create_mailboxer.rb → 20120123185900_create_mailboxer.rb} +0 -0
- data/spec/dummy/db/migrate/{20110719121059_add_notified_object.rb → 20120123185901_add_notified_object.rb} +0 -0
- data/spec/dummy/db/migrate/{20110912170902_add_notification_code.rb → 20120123185902_add_notification_code.rb} +0 -0
- data/spec/dummy/db/migrate/20120123185903_add_attachments.rb +13 -0
- data/spec/dummy/public/index.html +239 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/public/uploads/testfile.txt +1 -0
- data/spec/dummy/script/rails +1 -1
- data/spec/integration/message_and_receipt_spec.rb +2 -2
- data/spec/mailers/message_mailer_spec.rb +1 -1
- data/spec/mailers/notification_mailer_spec.rb +2 -2
- data/spec/models/conversation_spec.rb +1 -1
- data/spec/models/mailbox_spec.rb +1 -1
- data/spec/models/mailboxer_models_messageable_spec.rb +6 -2
- data/spec/models/message_spec.rb +1 -1
- data/spec/models/notification_spec.rb +1 -1
- data/spec/models/receipt_spec.rb +1 -1
- data/spec/testfile.txt +1 -0
- metadata +112 -59
- data/README.textile +0 -194
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/db/schema.rb +0 -73
- data/spec/dummy/public/javascripts/application.js +0 -2
- data/spec/dummy/public/javascripts/controls.js +0 -965
- data/spec/dummy/public/javascripts/dragdrop.js +0 -974
- data/spec/dummy/public/javascripts/effects.js +0 -1123
- data/spec/dummy/public/javascripts/prototype.js +0 -6001
- data/spec/dummy/public/javascripts/rails.js +0 -191
- data/spec/dummy/public/stylesheets/scaffold.css +0 -56
@@ -47,9 +47,9 @@ module Mailboxer
|
|
47
47
|
|
48
48
|
#Sends a messages, starting a new conversation, with the messageable
|
49
49
|
#as originator
|
50
|
-
def send_message(recipients, msg_body, subject,sanitize_text=true)
|
50
|
+
def send_message(recipients, msg_body, subject, sanitize_text=true, attachment=nil)
|
51
51
|
convo = Conversation.new({:subject => subject})
|
52
|
-
message = Message.new({:sender => self, :conversation => convo, :body => msg_body, :subject => subject})
|
52
|
+
message = Message.new({:sender => self, :conversation => convo, :body => msg_body, :subject => subject, :attachment => attachment})
|
53
53
|
message.recipients = recipients.is_a?(Array) ? recipients : [recipients]
|
54
54
|
message.recipients = message.recipients.uniq
|
55
55
|
return message.deliver false,sanitize_text
|
@@ -57,33 +57,33 @@ module Mailboxer
|
|
57
57
|
|
58
58
|
#Basic reply method. USE NOT RECOMENDED.
|
59
59
|
#Use reply_to_sender, reply_to_all and reply_to_conversation instead.
|
60
|
-
def reply(conversation, recipients, reply_body, subject
|
60
|
+
def reply(conversation, recipients, reply_body, subject=nil, sanitize_text=true, attachment=nil)
|
61
61
|
subject = subject || "RE: #{conversation.subject}"
|
62
|
-
response = Message.new({:sender => self, :conversation => conversation, :body => reply_body, :subject => subject})
|
62
|
+
response = Message.new({:sender => self, :conversation => conversation, :body => reply_body, :subject => subject, :attachment => attachment})
|
63
63
|
response.recipients = recipients.is_a?(Array) ? recipients : [recipients]
|
64
64
|
response.recipients = response.recipients.uniq
|
65
65
|
response.recipients.delete(self)
|
66
|
-
return response.deliver true,sanitize_text
|
66
|
+
return response.deliver true, sanitize_text
|
67
67
|
end
|
68
68
|
|
69
69
|
#Replies to the sender of the message in the conversation
|
70
|
-
def reply_to_sender(receipt, reply_body, subject
|
71
|
-
return reply(receipt.conversation, receipt.message.sender, reply_body, subject,sanitize_text)
|
70
|
+
def reply_to_sender(receipt, reply_body, subject=nil, sanitize_text=true, attachment=nil)
|
71
|
+
return reply(receipt.conversation, receipt.message.sender, reply_body, subject, sanitize_text, attachment)
|
72
72
|
end
|
73
73
|
|
74
74
|
#Replies to all the recipients of the message in the conversation
|
75
|
-
def reply_to_all(receipt, reply_body, subject
|
76
|
-
return reply(receipt.conversation, receipt.message.recipients, reply_body, subject,sanitize_text)
|
75
|
+
def reply_to_all(receipt, reply_body, subject=nil, sanitize_text=true, attachment=nil)
|
76
|
+
return reply(receipt.conversation, receipt.message.recipients, reply_body, subject, sanitize_text, attachment)
|
77
77
|
end
|
78
78
|
|
79
79
|
#Replies to all the recipients of the last message in the conversation and untrash any trashed message by messageable
|
80
80
|
#if should_untrash is set to true (this is so by default)
|
81
|
-
def reply_to_conversation(conversation, reply_body, subject
|
81
|
+
def reply_to_conversation(conversation, reply_body, subject=nil, should_untrash=true, sanitize_text=true, attachment=nil)
|
82
82
|
#move conversation to inbox if it is currently in the trash and should_untrash parameter is true.
|
83
83
|
if should_untrash && mailbox.is_trashed?(conversation)
|
84
84
|
mailbox.receipts_for(conversation).untrash
|
85
85
|
end
|
86
|
-
return reply(conversation, conversation.last_message.recipients, reply_body, subject,sanitize_text)
|
86
|
+
return reply(conversation, conversation.last_message.recipients, reply_body, subject, sanitize_text, attachment)
|
87
87
|
end
|
88
88
|
|
89
89
|
#Mark the object as read for messageable.
|
@@ -177,7 +177,16 @@ module Mailboxer
|
|
177
177
|
return nil
|
178
178
|
end
|
179
179
|
end
|
180
|
+
|
181
|
+
def search_messages(query)
|
182
|
+
@search = Receipt.search do
|
183
|
+
fulltext query
|
184
|
+
with :receiver_id, self.id
|
185
|
+
end
|
186
|
+
|
187
|
+
@search.results.map { |r| r.conversation }.uniq
|
188
|
+
end
|
180
189
|
end
|
181
190
|
end
|
182
191
|
end
|
183
|
-
end
|
192
|
+
end
|
data/mailboxer.gemspec
CHANGED
@@ -1,38 +1,43 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
s.name = "mailboxer"
|
3
|
+
s.version = "0.6.1"
|
4
|
+
s.authors = ["Eduardo Casanova Cuesta"]
|
5
|
+
s.summary = "Messaging system for rails apps."
|
6
|
+
s.description = "A Rails engine that allows any model to act as messageable, allowing it to exchange messages " +
|
7
|
+
"with any other messageable model, even different ones. It supports the use of conversations with " +
|
8
|
+
"two or more recipients to organize the messages. You have a complete use of a mailbox object for " +
|
9
|
+
"each messageable model that manages an inbox, sentbox and trash for conversations. It also supports " +
|
10
|
+
"sending notifications to messageable models, intended to be used as system notifications."
|
11
|
+
s.email = "ecasanovac@gmail.com"
|
12
|
+
s.homepage = "https://github.com/ging/mailboxer"
|
13
|
+
s.files = `git ls-files`.split("\n")
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
# Gem dependencies
|
16
|
+
#
|
17
|
+
# SQL foreign keys
|
18
|
+
s.add_runtime_dependency('foreigner', '>= 0.9.1')
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
s.add_runtime_dependency('rails', '
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
20
|
+
# Development Gem dependencies
|
21
|
+
#
|
22
|
+
s.add_runtime_dependency('rails', '> 3.0.0')
|
23
|
+
s.add_runtime_dependency('carrierwave', '>= 0.5.8')
|
24
|
+
s.add_runtime_dependency('sunspot_rails', '>= 1.3.0')
|
25
|
+
# Debugging
|
26
|
+
if RUBY_VERSION < '1.9'
|
27
|
+
s.add_development_dependency('ruby-debug', '>= 0.10.3')
|
28
|
+
end
|
29
|
+
# Specs
|
30
|
+
s.add_development_dependency('rspec-rails', '>= 2.6.1')
|
31
|
+
# Fixtures
|
32
|
+
s.add_development_dependency('factory_girl', '>= 1.3.2')
|
33
|
+
# Population
|
34
|
+
s.add_development_dependency('forgery', '>= 0.3.6')
|
35
|
+
# Integration testing
|
36
|
+
s.add_development_dependency('capybara', '>= 0.3.9')
|
37
|
+
# Searching
|
38
|
+
s.add_development_dependency('sunspot_solr', '>= 1.3.0')
|
39
|
+
# Testing database
|
40
|
+
s.add_development_dependency('sqlite3-ruby') unless RUBY_PLATFORM == 'java'
|
41
|
+
s.add_development_dependency('jdbc-sqlite3') if RUBY_PLATFORM == 'java'
|
42
|
+
s.add_development_dependency('activerecord-jdbcsqlite3-adapter') if RUBY_PLATFORM == 'java'
|
37
43
|
end
|
38
|
-
|
data/spec/dummy/Gemfile
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem '
|
3
|
+
gem 'rails', '~> 3.0.0'
|
4
|
+
gem 'mailboxer', :path => '../../'
|
4
5
|
|
5
|
-
|
6
|
+
# Bundle edge Rails instead:
|
7
|
+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
6
8
|
|
9
|
+
gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
|
10
|
+
gem "jdbc-sqlite3", :platform => :jruby
|
11
|
+
|
12
|
+
# Use unicorn as the web server
|
13
|
+
# gem 'unicorn'
|
14
|
+
|
15
|
+
# Deploy with Capistrano
|
16
|
+
# gem 'capistrano'
|
17
|
+
|
18
|
+
# To use debugger
|
19
|
+
# gem 'ruby-debug'
|
20
|
+
|
21
|
+
# Bundle the extra gems:
|
22
|
+
# gem 'bj'
|
23
|
+
# gem 'nokogiri'
|
24
|
+
# gem 'sqlite3-ruby', :require => 'sqlite3'
|
25
|
+
# gem 'aws-s3', :require => 'aws/s3'
|
26
|
+
|
27
|
+
# Bundle gems for the local environment. Make sure to
|
28
|
+
# put test-only gems in this group so their generators
|
29
|
+
# and rake tasks are available in development mode:
|
30
|
+
# group :development, :test do
|
31
|
+
# gem 'webrat'
|
32
|
+
# end
|
File without changes
|
File without changes
|
@@ -1,12 +1,8 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
require
|
4
|
-
require "active_record/railtie"
|
5
|
-
require "action_controller/railtie"
|
6
|
-
require "action_view/railtie"
|
7
|
-
require "action_mailer/railtie"
|
3
|
+
require 'rails/all'
|
8
4
|
|
9
|
-
Bundler.require
|
5
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
10
6
|
require "mailboxer"
|
11
7
|
|
12
8
|
module Dummy
|
@@ -43,3 +39,4 @@ module Dummy
|
|
43
39
|
config.filter_parameters += [:password]
|
44
40
|
end
|
45
41
|
end
|
42
|
+
|
@@ -1,5 +1,8 @@
|
|
1
1
|
# SQLite version 3.x
|
2
2
|
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
3
6
|
development:
|
4
7
|
adapter: sqlite3
|
5
8
|
database: db/development.sqlite3
|
@@ -11,9 +14,8 @@ development:
|
|
11
14
|
# Do not set this db to the same as development or production.
|
12
15
|
test:
|
13
16
|
adapter: sqlite3
|
14
|
-
database:
|
15
|
-
|
16
|
-
timeout: 5000
|
17
|
+
database: ":memory:"
|
18
|
+
timeout: 500
|
17
19
|
|
18
20
|
production:
|
19
21
|
adapter: sqlite3
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
5
|
# every request. This slows down response time but is perfect for development
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
3
|
|
4
4
|
# The production environment is meant for finished, "live" apps.
|
5
5
|
# Code is not reloaded between requests
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
5
|
# test suite. You never need to work with it otherwise. Remember that
|
@@ -7,6 +7,11 @@ Mailboxer.setup do |config|
|
|
7
7
|
config.default_from = "no-reply@mailboxer.com"
|
8
8
|
|
9
9
|
#Configures the methods needed by mailboxer
|
10
|
-
|
11
|
-
|
10
|
+
config.email_method = :mailboxer_email
|
11
|
+
config.name_method = :name
|
12
|
+
|
13
|
+
#Configures if you use or not a search engine and wich one are you using
|
14
|
+
#Supported enignes: [:solr,:sphinx]
|
15
|
+
config.search_enabled = false
|
16
|
+
config.search_engine = :solr
|
12
17
|
end
|
@@ -4,4 +4,4 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
Dummy::Application.config.secret_token = '
|
7
|
+
Dummy::Application.config.secret_token = '7fae989fc55949807eede0078ff2a5462e64c74e01e6c72a2900cb5d26f68cac114c8a854dda93e1b7675bf5a0d93ba105bf245176fa28a318c1cb5778a8ec0f'
|
@@ -4,5 +4,5 @@ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
|
|
4
4
|
|
5
5
|
# Use the database for sessions instead of the cookie-based default,
|
6
6
|
# which shouldn't be used to store highly confidential information
|
7
|
-
# (create the session table with "
|
7
|
+
# (create the session table with "rake db:sessions:create")
|
8
8
|
# Dummy::Application.config.session_store :active_record_store
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
-
# See
|
2
|
+
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
3
|
|
4
4
|
en:
|
5
5
|
hello: "Hello world"
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
Dummy::Application.routes.draw do
|
2
|
-
resources :users
|
3
|
-
|
4
2
|
# The priority is based upon order of creation:
|
5
3
|
# first created -> highest priority.
|
6
4
|
|
@@ -50,7 +48,7 @@ Dummy::Application.routes.draw do
|
|
50
48
|
|
51
49
|
# You can have the root of your site routed with "root"
|
52
50
|
# just remember to delete public/index.html.
|
53
|
-
root :to =>
|
51
|
+
root :to => 'home#index'
|
54
52
|
|
55
53
|
# See how all your routes lay out with "rake routes"
|
56
54
|
|
data/spec/dummy/db/migrate/{20110719111119_create_mailboxer.rb → 20120123185900_create_mailboxer.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,239 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Ruby on Rails: Welcome aboard</title>
|
5
|
+
<style type="text/css" media="screen">
|
6
|
+
body {
|
7
|
+
margin: 0;
|
8
|
+
margin-bottom: 25px;
|
9
|
+
padding: 0;
|
10
|
+
background-color: #f0f0f0;
|
11
|
+
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
|
12
|
+
font-size: 13px;
|
13
|
+
color: #333;
|
14
|
+
}
|
15
|
+
|
16
|
+
h1 {
|
17
|
+
font-size: 28px;
|
18
|
+
color: #000;
|
19
|
+
}
|
20
|
+
|
21
|
+
a {color: #03c}
|
22
|
+
a:hover {
|
23
|
+
background-color: #03c;
|
24
|
+
color: white;
|
25
|
+
text-decoration: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
#page {
|
30
|
+
background-color: #f0f0f0;
|
31
|
+
width: 750px;
|
32
|
+
margin: 0;
|
33
|
+
margin-left: auto;
|
34
|
+
margin-right: auto;
|
35
|
+
}
|
36
|
+
|
37
|
+
#content {
|
38
|
+
float: left;
|
39
|
+
background-color: white;
|
40
|
+
border: 3px solid #aaa;
|
41
|
+
border-top: none;
|
42
|
+
padding: 25px;
|
43
|
+
width: 500px;
|
44
|
+
}
|
45
|
+
|
46
|
+
#sidebar {
|
47
|
+
float: right;
|
48
|
+
width: 175px;
|
49
|
+
}
|
50
|
+
|
51
|
+
#footer {
|
52
|
+
clear: both;
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
#header, #about, #getting-started {
|
57
|
+
padding-left: 75px;
|
58
|
+
padding-right: 30px;
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
#header {
|
63
|
+
background-image: url("images/rails.png");
|
64
|
+
background-repeat: no-repeat;
|
65
|
+
background-position: top left;
|
66
|
+
height: 64px;
|
67
|
+
}
|
68
|
+
#header h1, #header h2 {margin: 0}
|
69
|
+
#header h2 {
|
70
|
+
color: #888;
|
71
|
+
font-weight: normal;
|
72
|
+
font-size: 16px;
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
#about h3 {
|
77
|
+
margin: 0;
|
78
|
+
margin-bottom: 10px;
|
79
|
+
font-size: 14px;
|
80
|
+
}
|
81
|
+
|
82
|
+
#about-content {
|
83
|
+
background-color: #ffd;
|
84
|
+
border: 1px solid #fc0;
|
85
|
+
margin-left: -55px;
|
86
|
+
margin-right: -10px;
|
87
|
+
}
|
88
|
+
#about-content table {
|
89
|
+
margin-top: 10px;
|
90
|
+
margin-bottom: 10px;
|
91
|
+
font-size: 11px;
|
92
|
+
border-collapse: collapse;
|
93
|
+
}
|
94
|
+
#about-content td {
|
95
|
+
padding: 10px;
|
96
|
+
padding-top: 3px;
|
97
|
+
padding-bottom: 3px;
|
98
|
+
}
|
99
|
+
#about-content td.name {color: #555}
|
100
|
+
#about-content td.value {color: #000}
|
101
|
+
|
102
|
+
#about-content ul {
|
103
|
+
padding: 0;
|
104
|
+
list-style-type: none;
|
105
|
+
}
|
106
|
+
|
107
|
+
#about-content.failure {
|
108
|
+
background-color: #fcc;
|
109
|
+
border: 1px solid #f00;
|
110
|
+
}
|
111
|
+
#about-content.failure p {
|
112
|
+
margin: 0;
|
113
|
+
padding: 10px;
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
#getting-started {
|
118
|
+
border-top: 1px solid #ccc;
|
119
|
+
margin-top: 25px;
|
120
|
+
padding-top: 15px;
|
121
|
+
}
|
122
|
+
#getting-started h1 {
|
123
|
+
margin: 0;
|
124
|
+
font-size: 20px;
|
125
|
+
}
|
126
|
+
#getting-started h2 {
|
127
|
+
margin: 0;
|
128
|
+
font-size: 14px;
|
129
|
+
font-weight: normal;
|
130
|
+
color: #333;
|
131
|
+
margin-bottom: 25px;
|
132
|
+
}
|
133
|
+
#getting-started ol {
|
134
|
+
margin-left: 0;
|
135
|
+
padding-left: 0;
|
136
|
+
}
|
137
|
+
#getting-started li {
|
138
|
+
font-size: 18px;
|
139
|
+
color: #888;
|
140
|
+
margin-bottom: 25px;
|
141
|
+
}
|
142
|
+
#getting-started li h2 {
|
143
|
+
margin: 0;
|
144
|
+
font-weight: normal;
|
145
|
+
font-size: 18px;
|
146
|
+
color: #333;
|
147
|
+
}
|
148
|
+
#getting-started li p {
|
149
|
+
color: #555;
|
150
|
+
font-size: 13px;
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
#sidebar ul {
|
155
|
+
margin-left: 0;
|
156
|
+
padding-left: 0;
|
157
|
+
}
|
158
|
+
#sidebar ul h3 {
|
159
|
+
margin-top: 25px;
|
160
|
+
font-size: 16px;
|
161
|
+
padding-bottom: 10px;
|
162
|
+
border-bottom: 1px solid #ccc;
|
163
|
+
}
|
164
|
+
#sidebar li {
|
165
|
+
list-style-type: none;
|
166
|
+
}
|
167
|
+
#sidebar ul.links li {
|
168
|
+
margin-bottom: 5px;
|
169
|
+
}
|
170
|
+
|
171
|
+
</style>
|
172
|
+
<script type="text/javascript">
|
173
|
+
function about() {
|
174
|
+
info = document.getElementById('about-content');
|
175
|
+
if (window.XMLHttpRequest)
|
176
|
+
{ xhr = new XMLHttpRequest(); }
|
177
|
+
else
|
178
|
+
{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
|
179
|
+
xhr.open("GET","rails/info/properties",false);
|
180
|
+
xhr.send("");
|
181
|
+
info.innerHTML = xhr.responseText;
|
182
|
+
info.style.display = 'block'
|
183
|
+
}
|
184
|
+
</script>
|
185
|
+
</head>
|
186
|
+
<body>
|
187
|
+
<div id="page">
|
188
|
+
<div id="sidebar">
|
189
|
+
<ul id="sidebar-items">
|
190
|
+
<li>
|
191
|
+
<h3>Browse the documentation</h3>
|
192
|
+
<ul class="links">
|
193
|
+
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
|
194
|
+
<li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
|
195
|
+
<li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
|
196
|
+
<li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
|
197
|
+
</ul>
|
198
|
+
</li>
|
199
|
+
</ul>
|
200
|
+
</div>
|
201
|
+
|
202
|
+
<div id="content">
|
203
|
+
<div id="header">
|
204
|
+
<h1>Welcome aboard</h1>
|
205
|
+
<h2>You’re riding Ruby on Rails!</h2>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
<div id="about">
|
209
|
+
<h3><a href="rails/info/properties" onclick="about(); return false">About your application’s environment</a></h3>
|
210
|
+
<div id="about-content" style="display: none"></div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
<div id="getting-started">
|
214
|
+
<h1>Getting started</h1>
|
215
|
+
<h2>Here’s how to get rolling:</h2>
|
216
|
+
|
217
|
+
<ol>
|
218
|
+
<li>
|
219
|
+
<h2>Use <code>rails generate</code> to create your models and controllers</h2>
|
220
|
+
<p>To see all available options, run it without parameters.</p>
|
221
|
+
</li>
|
222
|
+
|
223
|
+
<li>
|
224
|
+
<h2>Set up a default route and remove or rename this file</h2>
|
225
|
+
<p>Routes are set up in config/routes.rb.</p>
|
226
|
+
</li>
|
227
|
+
|
228
|
+
<li>
|
229
|
+
<h2>Create your database</h2>
|
230
|
+
<p>Run <code>rake db:migrate</code> to create your database. If you're not using SQLite (the default), edit <code>config/database.yml</code> with your username and password.</p>
|
231
|
+
</li>
|
232
|
+
</ol>
|
233
|
+
</div>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div id="footer"> </div>
|
237
|
+
</div>
|
238
|
+
</body>
|
239
|
+
</html>
|