Commit Graph

59 Commits

Author SHA1 Message Date
Prem Sichanugrist
0460b3a469 Fix bug in assert_template when using only :layout option
Currently if you're do this:

    assert_template :layout => "foo"

Regardless of what layout you were using, the test will always pass. This was broken since the introduction of :layout option in [d9375f3f].

We have a lot of test cases in actionpack/test/controller/layout_test.rb that use this feature. This will make sure that those test cases are not true negative.
2011-12-06 21:15:27 -05:00
José Valim
43d27e9105 Deprecate passing the template handler in the template name.
For example, calling hello.erb is now deprecated. Since Rails 3.0
passing the handler had no effect whatsover. This commit simply
deprecates such cases so we can clean up the code in later releases.
2011-09-22 15:37:38 +02:00
José Valim
c7408a0e40 Deprecate old template handler API. Remove old handlers. 2010-10-10 01:14:50 +02:00
Santiago Pastorino
bb75c33754 Config is deprecated on 1.8.8 and 1.9.3 use RbConfig 2010-08-23 23:10:36 -03:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
David Chelimsky
91125f9927 move FixtureResolver to a file that is accessible outside Rails' own tests
[#4522 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
Anil Wadghule
53c13f1aca Use Config::CONFIG['host_os'] instead of RUBY_PLATFORM [#4477 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-26 11:12:52 -07:00
Anil Wadghule
518891f490 Use correct RUBY_PLATFORM regex for Windows env [#4385 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-13 12:39:03 -07:00
Carlhuda
d9375f3f30 Modify assert_template to use notifications. Also, remove ActionController::Base#template since it is no longer needed. 2010-03-17 16:29:35 -07:00
Carlhuda
c1304098cc Reorganize autoloads:
* A new module (ActiveSupport::Autoload) is provide that extends
    autoloading with new behavior.
  * All autoloads in modules that have extended ActiveSupport::Autoload
    will be eagerly required in threadsafe environments
  * Autoloads can optionally leave off the path if the path is the same
    as full_constant_name.underscore
  * It is possible to specify that a group of autoloads live under an
    additional path. For instance, all of ActionDispatch's middlewares
    are ActionDispatch::MiddlewareName, but they live under 
    "action_dispatch/middlewares/middleware_name"
  * It is possible to specify that a group of autoloads are all found
    at the same path. For instance, a number of exceptions might all
    be declared there.
  * One consequence of this is that testing-related constants are not
    autoloaded. To get the testing helpers for a given component,
    require "component_name/test_case". For instance, "action_controller/test_case".
  * test_help.rb, which is automatically required by a Rails application's
    test helper, requires the test_case.rb for all active components, so
    this change will not be disruptive in existing or new applications.
2009-12-02 20:01:08 -08:00
Yehuda Katz + Carl Lerche
4fad953f90 Fixing pending tests and fixed some formats / partial rendering semantics 2009-06-17 12:54:19 -07:00
Yehuda Katz + Carl Lerche
1fbfa3e705 More _write_layout_method removal 2009-06-15 17:33:25 -07:00
Jeremy Kemper
ca72078388 Move fake controllers and models to a common load path 2009-05-22 16:11:54 -07:00
Yehuda Katz + Carl Lerche
72a574b507 Get controller/layout_test.rb running on new base except for ActionController::Base.exempt_from_layout which is going to be deprecated. 2009-05-22 15:25:13 -07:00
Yehuda Katz + Carl Lerche
68a207ccf6 Implemented layout conditions in new base 2009-05-21 18:14:20 -07:00
Joshua Peek
11af089cee Extract ActionController rescue templates into Rescue and ShowExceptions middleware.
This commit breaks all exception catching plugins like ExceptionNotifier. These plugins should be rewritten as middleware instead overriding Controller#rescue_action_in_public.
2009-05-02 23:02:22 -05:00
Joshua Peek
c0a372ba87 Deprecate template, session, assigns, and layout accessors on response object. Instead access them through the controller instance. This mainly affects functional test assertions. 2009-04-28 23:29:46 -05:00
Yehuda Katz + Carl Lerche
cecafc52ee Refactor ActionView::Template
ActionView::Template is now completely independent from template
  storage, which allows different back ends such as the database.
  ActionView::Template's only responsibility is to take in the
  template source (passed in from ActionView::Path), compile it,
  and render it.
2009-04-27 11:49:11 -07:00
Carl Lerche & Yehuda Katz
906aebceed Bring abstract_controller up to date with rails/master
Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list
of commits that could not be applied cleanly or are obviated with the
abstract_controller refactor. They all need to be revisited to ensure
that fixes made in 2.3 do not reappear in 3.0:

2259ecf368e6a6715966f69216e3ee86bf1a82a7
AR not available
  * This will be reimplemented with ActionORM or equivalent

06182ea02e92afad579998aa80144588e8865ac3
implicitly rendering a js response should not use the default layout
[#1844 state:resolved]
  * This will be handled generically

893e9eb99504705419ad6edac14d00e71cef5f12
Improve view rendering performance in development mode and reinstate
template recompiling in production [#1909 state:resolved]
  * We will need to reimplement rails-dev-boost on top of the refactor;
    the changes here are very implementation specific and cannot be
    cleanly applied. The following commits are implicated:

      199e750d46c04970b5e7684998d09405648ecbd4
      3942cb406e1d5db0ac00e03153809cc8dc4cc4db
      f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690
      e3b166aab37ddc2fbab030b146eb61713b91bf55
      ae9f258e03c9fd5088da12c1c6cd216cc89a01f7
      44423126c6f6133a1d9cf1d0832b527e8711d40f

0cb020b4d6d838025859bd60fb8151c8e21b8e84
workaround for picking layouts based on wrong view_paths
[#1974 state:resolved]
  * The specifics of this commit no longer apply. Since it is a two-line
    commit, we will reimplement this change.

8c5cc66a831aadb159f3daaffa4208064c30af0e
make action_controller/layouts pick templates from the current instance's
view_paths instead of the class view_paths [#1974 state:resolved]
  * This does not apply at all. It should be trivial to apply the feature
    to the reimplemented ActionController::Base.

87e8b162463f13bd50d27398f020769460a770e3
fix HTML fallback for explicit templates [#2052 state:resolved]
  * There were a number of patches related to this that simply compounded
    each other. Basically none of them apply cleanly, and the underlying
    issue needs to be revisited. After discussing the underlying problem
    with Koz, we will defer these fixes for further discussion.
2009-04-13 15:18:45 -07:00
Yehuda Katz and Carl Lerche
6c05b5e938 Temporarily modifies setup to call super directly. This can support more T::U runners. 2009-04-08 17:33:41 -07:00
thedarkone
3191535ff0 Fix layouts with absolute paths [#2134 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-05 18:49:22 -06:00
Sven Fuchs
8c5cc66a83 make action_controller/layouts pick templates from the current instance's view_paths instead of the class view_paths [#1974 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-20 14:19:45 -06:00
Yehuda Katz
eb9af20b7c Begin unifying the interface between ActionController and ActionView 2009-01-22 16:18:10 -06:00
Jeremy Kemper
c90572e3ab Use instance_eval instead of adding an accessor to the class 2009-01-07 14:49:12 -08:00
Yaroslav Markin
fdaa9ed033 Fix ActionPack build on Windows: we really should not test anything regarding symlinks on Windows.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-12-27 17:33:13 +00:00
Joshua Peek
9fc23745f1 Reinstate "Super lazy load view paths in development mode (no indexing or caching at all). Switch layout finders to use view path api to take advantage of cache." as it killed dev mode reloading." 2008-11-28 11:18:28 -06:00
David Heinemeier Hansson
5fa0457542 Revert "Super lazy load view paths in development mode (no indexing or caching at all). Switch layout finders to use view path api to take advantage of cache." as it killed dev mode reloading.
This reverts commit 4d910b033379727e5e7355590c50c72fc75e56db.
2008-11-27 21:04:24 +01:00
Joshua Peek
4d910b0333 Super lazy load view paths in development mode (no indexing or caching at all). Switch layout finders to use view path api to take advantage of cache. 2008-11-26 20:54:47 -06:00
Jeremy Kemper
c82e8e1f48 Move controller assertions from base TestCase to AC:: and AV::TestCase 2008-11-07 15:42:34 -05:00
Joshua Peek
086c3520c4 Moved layout exemption logic into the view 2008-08-31 11:34:46 -05:00
Ryan Bates
38c7d73e73 pass yielded arguments to block for ActionView::Base#render with :layout [#847 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-08-17 19:29:24 -05:00
Joshua Peek
d2ccb852d4 Removed lagacy TemplateHandler#render API. Left in a legacy TemplateHandler and Compilable stub so plugins will not have to change anything. 2008-07-18 16:00:20 -05:00
Joshua Peek
73b34e9f75 Refactor template preloading. New abstractions include Renderable mixins and a refactored Template class. 2008-07-12 14:33:46 -05:00
Joshua Peek
6ebdd0e32b Changed ActionView::TemplateHandler#render API method signature to render(template, local_assigns = {}) 2008-07-11 15:40:41 -05:00
Joshua Peek
01637796d7 Revert "Moved TemplateHandlers to Base"
This reverts commit 42d215a925a228778e43f7040f03ad8f3eb5341c.

Conflicts:

	actionpack/lib/action_view/inline_template.rb
	actionpack/lib/action_view/template.rb
2008-07-03 21:09:37 -05:00
Joshua Peek
42d215a925 Moved TemplateHandlers to Base 2008-07-03 12:48:00 -05:00
Pratik Naik
ef4c65088f Move missing template logic to ActionView 2008-04-19 18:59:13 +01:00
Jeremy Kemper
5c0656c9ee Fix layouts in symlinked paths. Closes #9136 [court3nay, caio]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9120 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-28 20:54:26 +00:00
Pratik Naik
a96272a0c5 Moved template handlers related code from ActionView::Base to ActionView::Template
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8981 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-05 02:03:24 +00:00
Michael Koziarski
51b6619d4e Refactor partial rendering into a PartialTemplate class. [Pratik]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8976 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-03 04:01:35 +00:00
Michael Koziarski
e6de95889d * Pass around handler instances, not their classes [Koz]
* Move compilation, rendering and 'compilable?' checks into the Handlers [Koz]
 * Remove delegate_* methods as the handler is now an instance [Koz]


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8624 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-11 04:45:06 +00:00
Jeremy Kemper
9d755f1983 require abstract_unit directly since test is in load path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:06 +00:00
Jeremy Kemper
0ee1cb2cd3 Ruby 1.9 compat, consistent load paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-02 05:32:14 +00:00
David Heinemeier Hansson
860cf2d44e Fixed that render template did not honor exempt_from_layout (closes #9698) [pezra]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7701 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 22:59:24 +00:00
Jeremy Kemper
f1b12b62f4 Fix layout overriding response status. Closes #9476.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-08 03:12:03 +00:00
Rick Olson
ebf9b3737b Add some performance enhancements to ActionView.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6736 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 06:36:34 +00:00
Rick Olson
f5b8fc0335 Allow layouts with extension of .html.erb. Closes #8032 [Josh Knowles]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6516 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-12 17:11:48 +00:00
David Heinemeier Hansson
e105653066 Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 22:09:12 +00:00
Rick Olson
69b0e5c44a Allow Controllers to have multiple view_paths instead of a single template_root. Closes #2754 [John Long]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6120 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-04 20:47:05 +00:00
Jeremy Kemper
55efae2720 Allow exempt_from_layout :rhtml. References #6742, closes #7026.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5927 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-14 13:57:44 +00:00