contact_form 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +16 -0
- data/Rakefile +3 -9
- data/app/controllers/contact_form/forms_controller.rb +1 -1
- data/app/models/contact_form/form.rb +2 -14
- data/{script → bin}/rails +2 -2
- data/lib/contact_form/version.rb +1 -1
- data/lib/generators/contact_form/views/views_generator.rb +0 -0
- data/test/contact_form_test.rb +7 -0
- data/test/dummy/README.rdoc +15 -248
- data/test/dummy/Rakefile +1 -2
- data/test/dummy/app/assets/javascripts/application.js +4 -6
- data/test/dummy/app/controllers/application_controller.rb +3 -1
- data/test/dummy/app/views/layouts/application.html.erb +3 -3
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +1 -1
- data/test/dummy/config/application.rb +1 -38
- data/test/dummy/config/boot.rb +4 -9
- data/test/dummy/config/environment.rb +3 -3
- data/test/dummy/config/environments/development.rb +11 -19
- data/test/dummy/config/environments/production.rb +40 -27
- data/test/dummy/config/environments/test.rb +13 -14
- data/test/dummy/config/initializers/backtrace_silencers.rb +1 -1
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +6 -5
- data/test/dummy/config/initializers/secret_token.rb +7 -2
- data/test/dummy/config/initializers/session_store.rb +0 -5
- data/test/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/test/dummy/{app/mailers/.gitkeep → db/development.sqlite3} +0 -0
- data/test/dummy/log/development.log +7140 -0
- data/test/dummy/public/404.html +43 -11
- data/test/dummy/public/422.html +43 -11
- data/test/dummy/public/500.html +43 -11
- data/test/dummy/tmp/cache/assets/B72/200/sprockets%2F100112045070b21989507834140b407e +0 -0
- data/test/dummy/tmp/cache/assets/C07/C20/sprockets%2F23f96a9a98364940682f7b0049593617 +0 -0
- data/test/dummy/tmp/cache/assets/C40/750/sprockets%2F932b4853154e1de413ea430160293d90 +0 -0
- data/test/dummy/tmp/cache/assets/C6E/B90/sprockets%2Fff7154913f353684d2c0d99757e49449 +0 -0
- data/test/dummy/tmp/cache/assets/C8D/960/sprockets%2F80704bcb99159699d05d23c5b8c51359 +0 -0
- data/test/dummy/tmp/cache/assets/C96/710/sprockets%2F84d7f0851597279bdb83ec03a4258868 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CE5/B20/sprockets%2F0414f9654b3526ded26bf229ff3a3991 +0 -0
- data/test/dummy/tmp/cache/assets/D0E/A10/sprockets%2F3dbd2904b612348b5f6bee880328a45f +0 -0
- data/test/dummy/tmp/cache/assets/D15/FA0/sprockets%2F7d2d7e4cd23102fd713798357ba6fe27 +0 -0
- data/test/dummy/tmp/cache/assets/D1B/270/sprockets%2F5e9eca4683e21a08467e309e58a85b5d +0 -0
- data/test/dummy/tmp/cache/assets/D1C/790/sprockets%2F435c4e591f70a09989abf87fa2e4237b +0 -0
- data/test/dummy/tmp/cache/assets/D1F/550/sprockets%2F48da9671da988a1246f97e47bb4ad453 +0 -0
- data/test/dummy/tmp/cache/assets/D22/570/sprockets%2F9d8fa6e74f0837d640d4a62fcf877503 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D35/CA0/sprockets%2Fbb633d31764aa9b172924df6d20af8e0 +0 -0
- data/test/dummy/tmp/cache/assets/D42/210/sprockets%2Fdbc251ff7ce5267f0c1ea2901890847f +0 -0
- data/test/dummy/tmp/cache/assets/D44/060/sprockets%2F83bb16519b63c22122ecd7e97c9d7b5f +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/870/sprockets%2Fc3f537585e0ada8e57c4dde292264d97 +0 -0
- data/test/dummy/tmp/cache/assets/D51/540/sprockets%2Fb54d1b014e60d760443aa2291dfeea0b +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D63/0B0/sprockets%2Fd721704cb7e2deb7f7217060db5d0b6e +0 -0
- data/test/dummy/tmp/cache/assets/D7F/230/sprockets%2Fe4c1b1e021f34b0e7ec335faaa34d225 +0 -0
- data/test/dummy/tmp/cache/assets/D84/960/sprockets%2F6c852e7dafc3627924fd803e29eef92e +0 -0
- data/test/dummy/tmp/cache/assets/D89/9A0/sprockets%2F78e59ee27f6a6bec54fe5fe61c271469 +0 -0
- data/test/dummy/tmp/cache/assets/D98/480/sprockets%2F4d543d040c82919aab83a096fdefab3f +0 -0
- data/test/dummy/tmp/cache/assets/D99/F00/sprockets%2Fa0e37f8fddbc2870208e4af3ba04e963 +0 -0
- data/test/dummy/tmp/cache/assets/D9D/140/sprockets%2F9aca53f75e5e31b7dce037720f46fbd2 +0 -0
- data/test/dummy/tmp/cache/assets/DAF/1B0/sprockets%2F22cc8a9bf92bf50c51ff4dd1cd886789 +0 -0
- data/test/dummy/tmp/cache/assets/DB3/0D0/sprockets%2F49bccc1cbb34101b079419bbf0cb64bc +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DDD/1E0/sprockets%2Ff5e71d28c8c9d3fe9149383dacbbba95 +0 -0
- data/test/dummy/tmp/cache/assets/DE1/D90/sprockets%2F5d9fc6c6f778db9a07f4290dbd3edf52 +0 -0
- data/test/dummy/tmp/cache/assets/DE5/260/sprockets%2Fa232edb1ad6f0fd06124b927fc2a5cda +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E1E/FD0/sprockets%2F75dbbffde194fb11db1d41c72be20eb5 +0 -0
- data/test/dummy/tmp/cache/assets/E29/290/sprockets%2Fd5b201f028958ced9cd25dccaceac58b +0 -0
- data/test/dummy/tmp/cache/assets/E67/2C0/sprockets%2F0fb09b733aea46e9addfa87942eeffbf +0 -0
- data/test/dummy/tmp/cache/assets/E96/650/sprockets%2Fdef5bdd5ccfea9f38a0daf0bd8939f24 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- metadata +170 -50
- data/.gitignore +0 -7
- data/Gemfile +0 -17
- data/Gemfile.lock +0 -100
- data/contact_form-0.0.1.gem +0 -0
- data/contact_form.gemspec +0 -26
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/script/rails +0 -6
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7b4c853e7d89dcad352428bf1f83bdea1117585d
|
4
|
+
data.tar.gz: 4f817b24361f6291c6bb9f9521a6e95701e13503
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3169a5a31b3ca116db0b87754dc40f016433ba4f2c910b50717297ddf572584709098717f227f3016c4f8e8a587d04b67824fb3a75e6217bd9612369507b6d79
|
7
|
+
data.tar.gz: 154fc99f9d78fc84f3920d148eee75423f97c80cbbed9e0c5a8768b278e85325d5799d2b9f755bb8f75cc5ab9d87b98e9d062d3caf0aece367eeb2e618394d82
|
data/README.rdoc
CHANGED
@@ -3,13 +3,29 @@
|
|
3
3
|
This gem contains a little contact form. It is build with a mountable engine.
|
4
4
|
It is simple and just sends two emails. Nothing gets saved to the database. The first email is to the website administrator and the second email is an auto reply to the user.
|
5
5
|
|
6
|
+
This gem is compatible with rails 4.0.0 and rails 3.2. For rails 3.2 you must use the version 0.0.2, or the branch "rails_32".
|
7
|
+
|
6
8
|
=== Quick Start
|
7
9
|
|
10
|
+
rails 4.0.0:
|
11
|
+
|
8
12
|
gem install contact_form
|
9
13
|
|
10
14
|
Or add it to your Gemfile:
|
11
15
|
|
12
16
|
gem "contact_form"
|
17
|
+
|
18
|
+
rails 3.2:
|
19
|
+
|
20
|
+
gem install contact_form -v 0.0.2
|
21
|
+
|
22
|
+
Or add it to your Gemfile:
|
23
|
+
|
24
|
+
gem "contact_form", "0.0.2"
|
25
|
+
|
26
|
+
or directly from the rails 3.2 branch from github:
|
27
|
+
|
28
|
+
gem "contact_form", :git => "https://github.com/mattherick/contact_form.git", :branch => "rails_32"
|
13
29
|
|
14
30
|
Run the generator to generate an initializer file, a config yml file and locale files
|
15
31
|
|
data/Rakefile
CHANGED
@@ -1,16 +1,10 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
1
|
begin
|
3
2
|
require 'bundler/setup'
|
4
3
|
rescue LoadError
|
5
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
5
|
end
|
7
|
-
|
8
|
-
|
9
|
-
rescue LoadError
|
10
|
-
require 'rdoc/rdoc'
|
11
|
-
require 'rake/rdoctask'
|
12
|
-
RDoc::Task = Rake::RDocTask
|
13
|
-
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
14
8
|
|
15
9
|
RDoc::Task.new(:rdoc) do |rdoc|
|
16
10
|
rdoc.rdoc_dir = 'rdoc'
|
@@ -37,4 +31,4 @@ Rake::TestTask.new(:test) do |t|
|
|
37
31
|
end
|
38
32
|
|
39
33
|
|
40
|
-
task :
|
34
|
+
task default: :test
|
@@ -8,7 +8,7 @@ module ContactForm
|
|
8
8
|
def create
|
9
9
|
@form = Form.new(params[:form])
|
10
10
|
if @form.valid?
|
11
|
-
|
11
|
+
FormMailer.new_contact(@form).deliver
|
12
12
|
FormMailer.auto_reply(@form).deliver
|
13
13
|
redirect_to after_create_contact_path, notice: I18n.t(".contact_form.controllers.forms_controller.success")
|
14
14
|
else
|
@@ -1,25 +1,13 @@
|
|
1
1
|
module ContactForm
|
2
2
|
class Form
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
extend ActiveModel::Naming
|
7
|
-
|
4
|
+
include ActiveModel::Model
|
5
|
+
|
8
6
|
attr_accessor :name, :email, :message
|
9
7
|
|
10
8
|
validates :name, presence: true
|
11
9
|
validates :email, presence: true, email: true
|
12
10
|
validates :message, presence: true
|
13
11
|
|
14
|
-
def initialize(attributes = {})
|
15
|
-
attributes.each do |name, value|
|
16
|
-
send("#{name}=", value)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def persisted?
|
21
|
-
false
|
22
|
-
end
|
23
|
-
|
24
12
|
end
|
25
13
|
end
|
data/{script → bin}/rails
RENAMED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
|
3
3
|
|
4
4
|
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
5
|
ENGINE_PATH = File.expand_path('../../lib/contact_form/engine', __FILE__)
|
6
6
|
|
7
7
|
require 'rails/all'
|
8
|
-
require 'rails/engine/commands'
|
8
|
+
require 'rails/engine/commands'
|
data/lib/contact_form/version.rb
CHANGED
File without changes
|
data/test/dummy/README.rdoc
CHANGED
@@ -1,261 +1,28 @@
|
|
1
|
-
==
|
1
|
+
== README
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
5
|
|
6
|
-
|
7
|
-
templates that are primarily responsible for inserting pre-built data in between
|
8
|
-
HTML tags. The model contains the "smart" domain objects (such as Account,
|
9
|
-
Product, Person, Post) that holds all the business logic and knows how to
|
10
|
-
persist themselves to a database. The controller handles the incoming requests
|
11
|
-
(such as Save New Account, Update Product, Show Post) by manipulating the model
|
12
|
-
and directing data to the view.
|
6
|
+
Things you may want to cover:
|
13
7
|
|
14
|
-
|
15
|
-
layer entitled Active Record. This layer allows you to present the data from
|
16
|
-
database rows as objects and embellish these data objects with business logic
|
17
|
-
methods. You can read more about Active Record in
|
18
|
-
link:files/vendor/rails/activerecord/README.html.
|
8
|
+
* Ruby version
|
19
9
|
|
20
|
-
|
21
|
-
layers by its two parts: Action View and Action Controller. These two layers
|
22
|
-
are bundled in a single package due to their heavy interdependence. This is
|
23
|
-
unlike the relationship between the Active Record and Action Pack that is much
|
24
|
-
more separate. Each of these packages can be used independently outside of
|
25
|
-
Rails. You can read more about Action Pack in
|
26
|
-
link:files/vendor/rails/actionpack/README.html.
|
10
|
+
* System dependencies
|
27
11
|
|
12
|
+
* Configuration
|
28
13
|
|
29
|
-
|
14
|
+
* Database creation
|
30
15
|
|
31
|
-
|
32
|
-
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
|
16
|
+
* Database initialization
|
33
17
|
|
34
|
-
|
35
|
-
<tt>cd myapp; rails server</tt> (run with --help for options)
|
18
|
+
* How to run the test suite
|
36
19
|
|
37
|
-
|
38
|
-
"Welcome aboard: You're riding Ruby on Rails!"
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
39
21
|
|
40
|
-
|
41
|
-
the following resources handy:
|
22
|
+
* Deployment instructions
|
42
23
|
|
43
|
-
*
|
44
|
-
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
|
24
|
+
* ...
|
45
25
|
|
46
26
|
|
47
|
-
|
48
|
-
|
49
|
-
Sometimes your application goes wrong. Fortunately there are a lot of tools that
|
50
|
-
will help you debug it and get it back on the rails.
|
51
|
-
|
52
|
-
First area to check is the application log files. Have "tail -f" commands
|
53
|
-
running on the server.log and development.log. Rails will automatically display
|
54
|
-
debugging and runtime information to these files. Debugging info will also be
|
55
|
-
shown in the browser on requests from 127.0.0.1.
|
56
|
-
|
57
|
-
You can also log your own messages directly into the log file from your code
|
58
|
-
using the Ruby logger class from inside your controllers. Example:
|
59
|
-
|
60
|
-
class WeblogController < ActionController::Base
|
61
|
-
def destroy
|
62
|
-
@weblog = Weblog.find(params[:id])
|
63
|
-
@weblog.destroy
|
64
|
-
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
The result will be a message in your log file along the lines of:
|
69
|
-
|
70
|
-
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
|
71
|
-
|
72
|
-
More information on how to use the logger is at http://www.ruby-doc.org/core/
|
73
|
-
|
74
|
-
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
|
75
|
-
several books available online as well:
|
76
|
-
|
77
|
-
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
|
78
|
-
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
|
79
|
-
|
80
|
-
These two books will bring you up to speed on the Ruby language and also on
|
81
|
-
programming in general.
|
82
|
-
|
83
|
-
|
84
|
-
== Debugger
|
85
|
-
|
86
|
-
Debugger support is available through the debugger command when you start your
|
87
|
-
Mongrel or WEBrick server with --debugger. This means that you can break out of
|
88
|
-
execution at any point in the code, investigate and change the model, and then,
|
89
|
-
resume execution! You need to install ruby-debug to run the server in debugging
|
90
|
-
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
|
91
|
-
|
92
|
-
class WeblogController < ActionController::Base
|
93
|
-
def index
|
94
|
-
@posts = Post.all
|
95
|
-
debugger
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
So the controller will accept the action, run the first line, then present you
|
100
|
-
with a IRB prompt in the server window. Here you can do things like:
|
101
|
-
|
102
|
-
>> @posts.inspect
|
103
|
-
=> "[#<Post:0x14a6be8
|
104
|
-
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
|
105
|
-
#<Post:0x14a6620
|
106
|
-
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
|
107
|
-
>> @posts.first.title = "hello from a debugger"
|
108
|
-
=> "hello from a debugger"
|
109
|
-
|
110
|
-
...and even better, you can examine how your runtime objects actually work:
|
111
|
-
|
112
|
-
>> f = @posts.first
|
113
|
-
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
114
|
-
>> f.
|
115
|
-
Display all 152 possibilities? (y or n)
|
116
|
-
|
117
|
-
Finally, when you're ready to resume execution, you can enter "cont".
|
118
|
-
|
119
|
-
|
120
|
-
== Console
|
121
|
-
|
122
|
-
The console is a Ruby shell, which allows you to interact with your
|
123
|
-
application's domain model. Here you'll have all parts of the application
|
124
|
-
configured, just like it is when the application is running. You can inspect
|
125
|
-
domain models, change values, and save to the database. Starting the script
|
126
|
-
without arguments will launch it in the development environment.
|
127
|
-
|
128
|
-
To start the console, run <tt>rails console</tt> from the application
|
129
|
-
directory.
|
130
|
-
|
131
|
-
Options:
|
132
|
-
|
133
|
-
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
|
134
|
-
made to the database.
|
135
|
-
* Passing an environment name as an argument will load the corresponding
|
136
|
-
environment. Example: <tt>rails console production</tt>.
|
137
|
-
|
138
|
-
To reload your controllers and models after launching the console run
|
139
|
-
<tt>reload!</tt>
|
140
|
-
|
141
|
-
More information about irb can be found at:
|
142
|
-
link:http://www.rubycentral.org/pickaxe/irb.html
|
143
|
-
|
144
|
-
|
145
|
-
== dbconsole
|
146
|
-
|
147
|
-
You can go to the command line of your database directly through <tt>rails
|
148
|
-
dbconsole</tt>. You would be connected to the database with the credentials
|
149
|
-
defined in database.yml. Starting the script without arguments will connect you
|
150
|
-
to the development database. Passing an argument will connect you to a different
|
151
|
-
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
|
152
|
-
PostgreSQL and SQLite 3.
|
153
|
-
|
154
|
-
== Description of Contents
|
155
|
-
|
156
|
-
The default directory structure of a generated Ruby on Rails application:
|
157
|
-
|
158
|
-
|-- app
|
159
|
-
| |-- assets
|
160
|
-
| |-- images
|
161
|
-
| |-- javascripts
|
162
|
-
| `-- stylesheets
|
163
|
-
| |-- controllers
|
164
|
-
| |-- helpers
|
165
|
-
| |-- mailers
|
166
|
-
| |-- models
|
167
|
-
| `-- views
|
168
|
-
| `-- layouts
|
169
|
-
|-- config
|
170
|
-
| |-- environments
|
171
|
-
| |-- initializers
|
172
|
-
| `-- locales
|
173
|
-
|-- db
|
174
|
-
|-- doc
|
175
|
-
|-- lib
|
176
|
-
| `-- tasks
|
177
|
-
|-- log
|
178
|
-
|-- public
|
179
|
-
|-- script
|
180
|
-
|-- test
|
181
|
-
| |-- fixtures
|
182
|
-
| |-- functional
|
183
|
-
| |-- integration
|
184
|
-
| |-- performance
|
185
|
-
| `-- unit
|
186
|
-
|-- tmp
|
187
|
-
| |-- cache
|
188
|
-
| |-- pids
|
189
|
-
| |-- sessions
|
190
|
-
| `-- sockets
|
191
|
-
`-- vendor
|
192
|
-
|-- assets
|
193
|
-
`-- stylesheets
|
194
|
-
`-- plugins
|
195
|
-
|
196
|
-
app
|
197
|
-
Holds all the code that's specific to this particular application.
|
198
|
-
|
199
|
-
app/assets
|
200
|
-
Contains subdirectories for images, stylesheets, and JavaScript files.
|
201
|
-
|
202
|
-
app/controllers
|
203
|
-
Holds controllers that should be named like weblogs_controller.rb for
|
204
|
-
automated URL mapping. All controllers should descend from
|
205
|
-
ApplicationController which itself descends from ActionController::Base.
|
206
|
-
|
207
|
-
app/models
|
208
|
-
Holds models that should be named like post.rb. Models descend from
|
209
|
-
ActiveRecord::Base by default.
|
210
|
-
|
211
|
-
app/views
|
212
|
-
Holds the template files for the view that should be named like
|
213
|
-
weblogs/index.html.erb for the WeblogsController#index action. All views use
|
214
|
-
eRuby syntax by default.
|
215
|
-
|
216
|
-
app/views/layouts
|
217
|
-
Holds the template files for layouts to be used with views. This models the
|
218
|
-
common header/footer method of wrapping views. In your views, define a layout
|
219
|
-
using the <tt>layout :default</tt> and create a file named default.html.erb.
|
220
|
-
Inside default.html.erb, call <% yield %> to render the view using this
|
221
|
-
layout.
|
222
|
-
|
223
|
-
app/helpers
|
224
|
-
Holds view helpers that should be named like weblogs_helper.rb. These are
|
225
|
-
generated for you automatically when using generators for controllers.
|
226
|
-
Helpers can be used to wrap functionality for your views into methods.
|
227
|
-
|
228
|
-
config
|
229
|
-
Configuration files for the Rails environment, the routing map, the database,
|
230
|
-
and other dependencies.
|
231
|
-
|
232
|
-
db
|
233
|
-
Contains the database schema in schema.rb. db/migrate contains all the
|
234
|
-
sequence of Migrations for your schema.
|
235
|
-
|
236
|
-
doc
|
237
|
-
This directory is where your application documentation will be stored when
|
238
|
-
generated using <tt>rake doc:app</tt>
|
239
|
-
|
240
|
-
lib
|
241
|
-
Application specific libraries. Basically, any kind of custom code that
|
242
|
-
doesn't belong under controllers, models, or helpers. This directory is in
|
243
|
-
the load path.
|
244
|
-
|
245
|
-
public
|
246
|
-
The directory available for the web server. Also contains the dispatchers and the
|
247
|
-
default HTML files. This should be set as the DOCUMENT_ROOT of your web
|
248
|
-
server.
|
249
|
-
|
250
|
-
script
|
251
|
-
Helper scripts for automation and generation.
|
252
|
-
|
253
|
-
test
|
254
|
-
Unit and functional tests along with fixtures. When using the rails generate
|
255
|
-
command, template test files will be generated for you and placed in this
|
256
|
-
directory.
|
257
|
-
|
258
|
-
vendor
|
259
|
-
External libraries that the application depends on. Also includes the plugins
|
260
|
-
subdirectory. If the app has frozen rails, those gems also go here, under
|
261
|
-
vendor/rails/. This directory is in the load path.
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/test/dummy/Rakefile
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
3
|
|
5
4
|
require File.expand_path('../config/application', __FILE__)
|
6
5
|
|
7
|
-
Dummy::Application.load_tasks
|
6
|
+
Dummy::Application.load_tasks
|
@@ -5,11 +5,9 @@
|
|
5
5
|
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
//
|
8
|
+
// compiled file.
|
9
9
|
//
|
10
|
-
//
|
11
|
-
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
12
|
//
|
13
|
-
//=
|
14
|
-
//= require jquery_ujs
|
15
|
-
//= require_tree .
|
13
|
+
//= require_tree .
|
@@ -2,12 +2,12 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Dummy</title>
|
5
|
-
<%= stylesheet_link_tag "application", :
|
6
|
-
<%= javascript_include_tag "application" %>
|
5
|
+
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
6
|
+
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
7
7
|
<%= csrf_meta_tags %>
|
8
8
|
</head>
|
9
9
|
<body>
|
10
|
-
|
10
|
+
|
11
11
|
<%= flash_errors_and_notices %>
|
12
12
|
<%= yield %>
|
13
13
|
|