Commit Graph

5232 Commits

Author SHA1 Message Date
wycats
0904e82568 Delegate everything to the generator 2010-10-06 02:58:49 -07:00
wycats
848eb0d777 Revert "Clean up the builder abstraction in AppGenerator."
The phrase "clean up" misrepresents the fact that this removes
a feature that ships with Rails 3.0.

This reverts commit 6774e12afa0f29442aa612ddf6e51d5a1b7a4356.
2010-10-06 02:53:00 -07:00
José Valim
6774e12afa Clean up the builder abstraction in AppGenerator.
This commit may be reverted once documentation and a proper way to handle actions are added.
2010-10-06 11:13:57 +02:00
Aditya Sanghi
ae812e9fc9 adding test for namedspaced mailers 2010-10-06 19:45:13 +11:00
Xavier Noria
3b7d48cc45 a couple of touches to the guides guidelines 2010-10-05 22:52:43 +02:00
Xavier Noria
da34ee423f aaaaannnddd, your beloved typo only spotted in the github colored diff no matter how many passes you did before pushing 2010-10-05 19:38:05 +02:00
Xavier Noria
360a878070 new guide: Ruby on Rails Guides Guidelines 2010-10-05 19:34:27 +02:00
José Valim
68d75c3365 Don't expect an AD::Response object back from the app. 2010-10-05 09:55:51 +02:00
José Valim
4a4ff148ff Use RbConfig instead of Config for 1.9.3 compatibility. 2010-10-05 09:48:32 +02:00
José Valim
848e48ec9c Link to rack from github for this while. 2010-10-04 18:08:03 +02:00
José Valim
10d014acb8 Update to Thor 0.14.3. 2010-10-04 13:46:37 +02:00
Piotr Sarnacki
adfd43a4da Add documentation on app_generators 2010-10-03 23:32:03 +02:00
José Valim
74dd8a3681 Move ETag and ConditionalGet logic from AD::Response to the middleware stack. 2010-10-03 21:25:22 +02:00
José Valim
49cc01002e Be more explicit about what is deprecated. 2010-10-02 09:40:54 -07:00
José Valim
04cbabb0a0 Deprecate generators in Railties. You should use app_generators instead. 2010-10-02 18:38:23 +02:00
José Valim
757bbd540c :'' is not valid ruby. 2010-10-02 18:30:38 +02:00
José Valim
7b0c592e38 reload_routes! is part of the public API and should not be removed. 2010-10-02 17:45:26 +02:00
José Valim
609849a0f1 Fix a routing test. Reorganize middleware tests. 2010-10-02 17:42:36 +02:00
Xavier Noria
542ddd8c89 brings csrf_meta_tags back to the generated layout
After more discussion, it has be agreed that this kind
of changes within reasonable margins are OK for 3.1.
That is, it is fine to change a little bit the generators
even if that means examples in existing books won't be
exact. (Note that the singular csrf_meta_tag exists as an
alias and thus those outdated examples will run, same for
existing applications.)
2010-10-02 00:10:32 +02:00
Neeraj Singh
33733d5d1d no need to check for nil 2010-09-30 23:59:09 +08:00
José Valim
6b248f6ea5 Add more information to comments. 2010-09-30 10:33:31 +02:00
Piotr Sarnacki
9f569c60ad Try to guess application's directory while trying to run the server, but only if config.ru is not present in current dir 2010-09-30 10:27:55 +02:00
Piotr Sarnacki
3049e645e5 Moved Rails::RoutesReloader to Rails::Application::RoutesReloader 2010-09-30 09:47:06 +02:00
Piotr Sarnacki
6648babded Allow running generators for Engine with usage of other application.
After that commit, developers can set ENGINE_PATH in ENGINE/scripts/rails
file and load application's ./script/rails (most of the time it will be
dummy application used for testing). When running ./script/rails g it will
use application to boot up, but then it will use Engine's root and
configuration for generators.
2010-09-30 09:47:06 +02:00
Piotr Sarnacki
f851352318 Added config.app_generators to allow configuring application's generators from railties.
With config.generators becomes a way to configure generators
for current instance only. For example:

module Blog
  class Engine < Rails::Engine
    config.generators do |g|
      g.orm :active_record
    end

    config.app_generators do |g|
      g.test_framework :rspec
    end
  end
end

such definition sets :active_record as orm for engine and :rspec
as test_framework for application. The values set with app_generators
can be overwritten in application using config.generators as you would
normally do:

module MyApp
  class Application < Rails::Application
    config.generators do |g|
      g.test_framework :test_unit
    end
  end
end
2010-09-30 09:47:06 +02:00
Piotr Sarnacki
57aa79e6be Move routes_reloader to a class: RoutesReloader 2010-09-30 09:47:06 +02:00
Piotr Sarnacki
ec5d846ac6 Properly reload routes defined in class definition
Sometimes it's easier to define routes inside Engine or
Application class definition (e.g. one file applications). The
problem with such case is that if there is a plugin that
has config/routes.rb file, it will trigger routes reload on application.
Since routes definition for application is not in config/routes.rb
file routes_reloader will fail to reload application's routes
properly. With this commit you can pass routes definition as a block
to routes method, which will allow to properly reload it:

class MyApp::Application < Rails::Application
  routes do
    resources :users
  end
end
2010-09-30 09:47:05 +02:00
Piotr Sarnacki
74598fe7e9 Do not overwrite _railtie method on namespace while creating isolated engine or application.
In order to run Engine as standalone application, you will need
Rails::Application instance in the same namespace that engine
one. It's very important to leave _railtie bound to whatever
used "namespace" method first.
2010-09-30 09:47:05 +02:00
Xavier Noria
a617f6bc4c Merge branch 'master' of github.com:lifo/docrails 2010-09-29 20:26:42 +02:00
Joost Baaij
b1acba7bb8 Cleanup of the References section.
Removed non-functional links.
Removed links to API documentation.
Removed link to Rails 2 material.

Renamed "References" to "Further Reading".
2010-09-29 15:56:16 +02:00
Joost Baaij
3c620bed8c Removed obsolete "advanced" plugin URLs.
These plugins are obsolete even for Rails 2, they have no place in a Rails 3 guide.
Also removed "mad cool" reference.

If anyone has ideas about cache plugins that *must* be included, I would love to know.
As far as I am concerned the rails guides should stick to built-in methods and have a
simple list of references for people wishing to investigate further.

I will check out the references after this commit to see if they're up to date.
2010-09-29 15:51:09 +02:00
Santiago Pastorino
006cef7107 Add gem 'arel' from git commented out as an example of how to Bundle egde Rails with Arel edge
[#5723 state:committed]
2010-09-29 00:14:48 -03:00
Santiago Pastorino
14d2feeeab Bump up some deps 2010-09-26 00:29:38 -03:00
Carlos Antonio da Silva
7fc1edd790 Remove deprecated stuff in ActionController
This removes all deprecated classes in ActionController related to
Routing, Abstract Request/Response and Integration/IntegrationTest.
All tests and docs were changed to ActionDispatch instead of ActionController.
2010-09-26 02:13:45 +08:00
Piotr Sarnacki
f8294cb8ba Fix app and actions generators tests
Normally Rails.application is an instance, but for those
tests Rails.application needs to be class.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 17:28:39 +02:00
Piotr Sarnacki
0134c5cc94 Refactor a few methods connected with namespacing in Rails::Generators::NamedBase
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 17:28:10 +02:00
Piotr Sarnacki
51c7660e08 Add namespacing to mailer generator
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 17:28:10 +02:00
Piotr Sarnacki
7acf64a81b Add namespacing for observer generator
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 17:28:10 +02:00
Piotr Sarnacki
49c3ad7f77 Add namespace for test_unit generators
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 17:28:10 +02:00
Aditya Sanghi
de880302bd review comments 2010-09-25 15:04:25 +05:30
Aditya Sanghi
db8b3e71dc add section about email with name 2010-09-25 14:49:28 +05:30
José Valim
e6d503bcfb Update abort message (ht: tilsammans). 2010-09-25 11:01:43 +02:00
Aditya Sanghi
c94e92e2b0 Add section about multiple recipients 2010-09-25 14:31:19 +05:30
Piotr Sarnacki
135d6164c5 Rails.application is set anyway, we don't need to set it manually, this was purpose of different behavior in tests and in application
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 10:46:22 +02:00
Piotr Sarnacki
00aa13bc0e Generators fix: properly check if module should be created when creating a namespaced model
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 10:46:22 +02:00
Kulbir Saini
b1603990df Fixed routing examples in Routing guide. Updated URL to RoutingAssertions module. 2010-09-25 06:24:27 +05:30
Kulbir Saini
f488499c26 Updated 'Action Controller Overview' guide to rails 3 and fixed a few URLs throwing 404s. 2010-09-25 05:06:10 +05:30
Kulbir Saini
c941cba170 Updated all forms to accept UTF-8 encoding in Form Helpers guide wrt Rails 3. 2010-09-25 03:03:22 +05:30
Jeff Kreeftmeijer
d82d98dcd5 got rid of the "ambiguous first argument; put parentheses or even spaces" warnings in the scaffold_generator tests [#4872 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-24 16:17:39 -03:00
José Valim
127da544bb Bump thor version requirement. 2010-09-24 21:03:12 +02:00