Commit Graph

480 Commits

Author SHA1 Message Date
Philipe Fatio
47860b62b3 Require action_view to fix missing constant
Previously, requiring action_view/view_paths did cause an uninitialized
constant error for ENCODING_FLAG, which is defined in action_view.
2014-02-07 17:48:18 +01:00
Carlos Antonio da Silva
618d5317d3 Move the null mime type to request.format
TLDR: always return an object that responds to the query methods from
request.format, and do not touch Mime::Type[] lookup to avoid bugs.

---

Long version:

The initial issue was about being able to do checks like
request.format.html? for request with an unknown format, where
request.format would be nil.

This is where the issue came from at first in #7837 and #8085
(merged in cba05887dc3b56a46a9fe2779b6b228880b49622), but the
implementation went down the path of adding this to the mime type
lookup logic.

This unfortunately introduced subtle bugs, for instance in the merged
commit a test related to send_file had to be changed to accomodate the
introduction of the NullType.

Later another bug was found in #13064, related to the content-type being
shown as #<Mime::NullType:...> for templates with localized extensions
but no format included. This one was fixed in #13133, merged in
43962d6ec50f918c9970bd3cd4b6ee5c7f7426ed.

Besides that, custom handlers were not receiving the proper template
formats anymore when passing through the rendering process, because of
the NullType addition. That was found while migrating an application
from 3.2 to 4.0 that uses the Markerb gem (a custom handler that
generates both text and html emails from a markdown template).

---

This changes the implementation moving away from returning this null
object from the mime lookup, and still fixes the initial issue where
request.format.zomg? would raise an exception for unknown formats due to
request.format being nil.
2013-12-23 16:16:49 -02:00
Vijay Dev
a3b1105ada Merge branch 'master' of github.com:lifo/docrails 2013-12-20 00:10:30 +05:30
Łukasz Strzałkowski
d99dd0af03 Require action_view explicitly in AC::Base 2013-12-08 13:03:41 +01:00
Jeremy Kemper
5086c8c211 Merge pull request #13189 from strzalek/retain-ap-av-dep
Retain ActionPack dependency on ActionView. Fixes #12979.
2013-12-05 07:25:17 -08:00
Łukasz Strzałkowski
d8888b94b3 Retain ActionPack dependency on ActionView 2013-12-05 01:02:46 +01:00
Carlos Antonio da Silva
3b40a5d83d Improve a couple exception messages related to variants and mime types
Avoid one-liner conditionals when they are too big. Avoid concatenating
strings to build error messages. Improve messages a bit.
2013-12-03 22:23:12 -02:00
Łukasz Strzałkowski
2d3a6a0cb8 Action Pack Variants
By default, variants in the templates will be picked up if a variant is set
and there's a match. The format will be:

  app/views/projects/show.html.erb
  app/views/projects/show.html+tablet.erb
  app/views/projects/show.html+phone.erb

If request.variant = :tablet is set, we'll automatically be rendering the
html+tablet template.

In the controller, we can also tailer to the variants with this syntax:

  class ProjectsController < ActionController::Base
    def show
      respond_to do |format|
        format.html do |html|
          @stars = @project.stars

          html.tablet { @notifications = @project.notifications }
          html.phone  { @chat_heads    = @project.chat_heads }
        end

        format.js
        format.atom
      end
    end
  end

The variant itself is nil by default, but can be set in before filters, like
so:

  class ApplicationController < ActionController::Base
    before_action do
      if request.user_agent =~ /iPad/
        request.variant = :tablet
      end
    end
  end

This is modeled loosely on custom mime types, but it's specifically not
intended to be used together. If you're going to make a custom mime type,
you don't need a variant. Variants are for variations on a single mime
types.
2013-12-04 00:13:16 +01:00
Lauro Caetano
b1b9a0aeca Typos. return -> returns. [ci skip] 2013-12-03 13:31:36 -02:00
Aaron Patterson
267e5c84f9 calculate the ivars to remove in advance as a set and cache them in a
constant.

`view_assigns` can use the precalculated sets and remove instance
variables without allocating any extra arrays
2013-11-06 14:21:40 -08:00
Aaron Patterson
c8b566d54d use a set and reject to avoid array allocations 2013-11-06 14:11:37 -08:00
Aaron Patterson
779cd6ec61 each_with_object on the view_assigns hash 2013-11-06 13:54:15 -08:00
Aaron Patterson
9a4adb4b05 use slice to avoid range allocation 2013-11-06 13:53:52 -08:00
Aaron Patterson
697acc4025 these variables are also private 2013-11-06 13:37:24 -08:00
Aaron Patterson
32e94a488f instance_variables returns symbols, so we should use symbols in our list 2013-11-06 13:24:00 -08:00
Max Melentiev
fde7344542 ActionController#translate also lookups shortcut without action name 2013-10-22 18:17:05 +04:00
printercu
40a8130bc5 ActionController#translate supports symbols
Made it similar to views helper.
2013-09-25 16:23:28 +04:00
Santiago Pastorino
a46fa8df06 Make AC standalone rendering work 2013-09-10 11:01:12 -03:00
José Valim
1385ae138d Remove BasicRendering tests 2013-09-09 16:10:41 -03:00
José Valim
67336ce199 Remove remaining coupling with AV in MimeResponds 2013-09-09 12:33:53 -03:00
José Valim
a41669563b Remove BasicRendering and remove template functionality from AbsC::Rendering 2013-09-09 12:33:53 -03:00
Łukasz Strzałkowski
eddf367b89 Move BasicRendering to AbstractController 2013-09-03 15:03:56 +02:00
Łukasz Strzałkowski
d35cf4b6a0 Make Mime::TEXT default format in AbstractController 2013-09-03 14:58:46 +02:00
Łukasz Strzałkowski
aea02eb430 Move skeleton methods from AV to AbsC
The methods:

 * #render_to_body
 * #render_to_string
 * #_normalize_render

Haven't had anything specyfic to ActionView. This was common code which should belong to AbstractController
2013-09-03 14:57:37 +02:00
Łukasz Strzałkowski
544d0fad3d Return to using protected_instance_variables in AV 2013-09-02 23:18:02 +02:00
Łukasz Strzałkowski
40fcb9e822 Revert "Port all remaining self.protected_instance_variables to class methods"
This reverts commit 7de994fa215e9f4c2856d85034bc4dd7b65d0c01.
2013-09-02 23:18:02 +02:00
Łukasz Strzałkowski
7de994fa21 Port all remaining self.protected_instance_variables to class methods 2013-08-29 12:13:45 +02:00
Łukasz Strzałkowski
7d810049fe Add #rendered_format method to controllers 2013-08-25 11:39:13 +02:00
Łukasz Strzałkowski
1656f58f07 Improve AV::Rendering docs 2013-08-25 11:39:11 +02:00
Łukasz Strzałkowski
d6363aa180 Code formatting & typo fixes 2013-08-25 11:39:09 +02:00
Łukasz Strzałkowski
b9b48c7806 Remove abstract_controller load hooks 2013-08-25 11:39:09 +02:00
Łukasz Strzałkowski
49608f7b81 Move protected_instance_variables & view_assigns to AbstractController 2013-08-25 11:39:09 +02:00
Łukasz Strzałkowski
8e3413d410 Create AbstractController::Rendering interface
This interface should be use when implementing renderers.
2013-08-25 11:39:09 +02:00
Łukasz Strzałkowski
c90971644a Revert "Rename abstract_controller/rendering. to errors.rb"
This reverts commit 6fe91ec5008838338e54ab8570f7c95ee0cdd8e8.
2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski
cad8a20187 Rename abstract_controller/rendering. to errors.rb
Since all rendering stuff was extracted to AV, the only thing that left was single class with error so file name wasn't relevant anymore
2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski
766fa97b45 Hook up AV::Rendering on AV intialization 2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski
5759531a95 Move rendering from AP to AV 2013-08-25 11:39:07 +02:00
Łukasz Strzałkowski
1b446d06dd Move view_paths from AP to AV 2013-08-25 11:39:07 +02:00
Nicholas Jakobsen
55cbb85fb7 Execute conditional procs on controller filters only for current action.
:only and :except options for controller filters are now added before
:if and :unless. This prevents running :if and :unless procs when not
on the specified. Closes #11786.
2013-08-10 09:13:20 -07:00
Yves Senn
5bee14f3a4 move MissingHelperError out of the ClassMethods module. 2013-07-12 15:34:29 +02:00
Piotr Niełacny
e0438b1c07 Show real LoadError on helpers require
When helper try to require missing file rails will throw exception about
missing helper.

  # app/helpers/my_helper.rb

  require 'missing'

  module MyHelper
  end

And when we try do load helper

  class ApplicationController
    helper :my
  end

Rails will throw exception. This is wrong because there is a helper
file.

  Missing helper file helpers/my_helper.rb

Now when helper try to require non-existed file rails will throw proper
exception.

  No such file to load -- missing
2013-07-10 11:26:43 +02:00
Neeraj Singh
70568b4bbd use extract_options! 2013-07-02 22:46:31 +05:30
Aaron Patterson
ba55276434 deprecating string based terminators 2013-05-14 16:03:09 -07:00
printercu
14c196e5a3 Avoid leak into controller's action_methods 2013-04-18 20:03:31 +04:00
Sam Ruby
04cda1848c Prefer find_by over dynamic finders in rdoc 2013-04-02 15:09:15 -04:00
Carlos Antonio da Silva
0c5552a3dd Fix typos in AP: "overriden" => "overridden" 2013-03-30 15:17:08 -03:00
Vijay Dev
6d8c070821 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
	activerecord/test/cases/adapter_test.rb
	guides/source/testing.md

[ci skip]
2013-03-30 15:46:14 +05:30
Anupam Choudhury
a895b4087d Fixed grammar 2013-03-28 16:43:14 +05:30
Rafael Mendonça França
e7438501d6 Merge pull request #8458 from lucisferre/improve-layout-override-fallback-behavior
Provides standard layout lookup behavior for method and proc cases

Conflicts:
	actionpack/CHANGELOG.md
2013-03-27 16:09:12 -03:00
Chris Nicola
ef27bba63d Provides standard layout lookup behavior for method and proc cases
When setting the layout either by referencing a method or supplying a
Proc there is no way to fall back to the default lookup behavior if
desired. This patch allows fallback to the layout lookup behavior when
returning nil from the proc or method.
2013-03-27 10:59:50 -07:00
Tatsuro Baba
396bb77199 Capitalize the first letter of sentence 2013-03-18 18:31:24 +09:00
Bryan Ricker
fa63f83fd4 Remove :all from *args options in AbstractController.helper 2013-03-16 15:21:42 -07:00
robertomiranda
3bf961d7fd change useless gsub to tr 2013-03-05 09:33:42 -05:00
José Valim
5c1354901e Improve docs for AbsC::Rendering 2013-02-27 08:30:46 -07:00
Carlos Antonio da Silva
2061c98b42 Review #translate docs [ci skip] 2013-01-20 22:49:42 -02:00
Jens Bissinger
37d15d4e1b Add documentation for abstract controller #translate and #localize method. 2013-01-20 19:15:15 +01:00
Gosha Arinich
7a439d23de delegate to :class rather than 'self.class' 2013-01-06 12:43:30 +03:00
Akira Matsuda
370bfda55f replace use of MissingSourceFile with LoadError 2013-01-04 16:46:22 +09:00
Vijay Dev
e0176bf732 Merge branch 'master' of github.com:lifo/docrails 2012-12-21 23:14:08 +05:30
Vijay Dev
6fee8f3ce6 Revert "Fix incorrect adjustment 4c41e87e3ae548c44810b66437b2f0f6e73b2106"
This reverts commit e1f8ec59f2cc83f052b15233147aa2d6d8114a4d.

Reason: seems bad styling

[ci skip]
2012-12-21 23:03:52 +05:30
kei
e1f8ec59f2 Fix incorrect adjustment 4c41e87e3ae548c44810b66437b2f0f6e73b2106 2012-12-20 18:24:31 +09:00
kei
4c41e87e3a Fix documentation style 2012-12-20 18:10:21 +09:00
Andrew White
dcb318ee43 Make conditional_layout? private and update documentation
The conditional_layout? method is not for public use and doesn't
actually do what the documentation suggested it does. It's actually
used to determine whether or not to use the explicit layout definition
defined in a controller or use the implicit layout definition.

Also documentation was added for the action_has_layout? method which
acts as a master switch for disabling the layout for the current
action. This method was added so that action caching didn't depend
on accessing layout internals but is also used by third-parties,
most notably the [Hobo][1] application.

[1]: https://github.com/hobo/hobo
2012-12-17 16:29:38 +00:00
Carlos Antonio da Silva
cff0e51ae9 Refactor helpers code in Action Pack a bit
* Avoid calling class_eval when not needed
* Remove helpers_path attr accessor, it's defined as a class attribute a
  few lines later
* Avoid creating extra arrays when finding helpers, use flat_map and sort!
* Remove not required refer variable when redirecting :back
2012-12-13 08:46:12 -02:00
Francesco Rodriguez
f53132deea fix prepend_before_filter documentation [ci skip] 2012-12-07 14:28:32 -05:00
David Heinemeier Hansson
9d62e04838 Rename all action callbacks from *_filter to *_action 2012-12-07 18:54:44 +01:00
Alvaro Pereyra
4940d6d096 Cleans and removes useless 'Examples' tag [ci skip] 2012-12-01 15:19:45 -05:00
Vijay Dev
7b70eeed43 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_dispatch/routing/redirection.rb
2012-11-17 01:50:49 +05:30
Steve Klabnik
c4e3b0cd8b Removing duplication in callback normalization.
These two things were 100% identical.
2012-11-09 14:43:03 +01:00
AvnerCohen
08d3e534ab Hash Syntax to 1.9 converison 2012-11-07 16:50:10 +02:00
Yves Senn
4d7f53379a cleanup, remove trailing whitespace within actionpack 2012-10-27 16:03:18 +02:00
Aaron Patterson
6033e8aeb0 fix uninitialized ivar warnings 2012-10-25 10:49:13 -07:00
Joshua Peek
c800e27ad3 Merge branch 'master' into asset-path-helper
Conflicts:
	railties/test/application/configuration_test.rb
2012-10-15 10:20:50 -05:00
Joshua Peek
3db69909b9 🔥 Rails asset id support 2012-10-15 09:47:16 -05:00
Nihad Abbasov
ecee64192f remove 'then' from conditional statement 2012-10-14 21:08:25 +06:00
Ayrton De Craene
8d9f9f9dfb Fixed indendation 2012-08-29 10:25:36 +02:00
Sergey Pchelincev
1b5298e805 add lazy look up in abstract controller's translate method 2012-07-18 10:33:14 +03:00
Mircea Pricop
021f3d24f3 Prevent conflict between mime types and Object methods
Assuming the type ":touch", Collector.new was calling
send(:touch), which instead of triggering method_missing
and generating a new collector method, actually
invoked the private method `touch` inherited from
Object.

By generating the method for each mime type as it
is registered, the private methods on Object can
never be reached by `send`, because the `Collector`
will have them before `send` is called on it.

To do this, a callback mechanism was added to Mime::Type

This allows someone to add a callback for whenever
a new mime type is registered. The callback then
gets called with the new mime as a parameter.

This is then used in AbstractController::Collector
to generate new collector methods after each mime
is registered.
2012-07-06 20:38:23 +02:00
Nick Sutterer
1b01ab4959 remove AV.prepare and move all helper-related logic into the controller. this decouples the view since it no longer knows about routes internals.
this is a result of an ongoing discussion at https://github.com/rails/rails/pull/6826.
2012-06-29 11:33:37 +02:00
Aaron Patterson
b9b9e39bab i suck, fixing error message 2012-06-14 09:37:58 -07:00
Aaron Patterson
99c9d18601 Wrap up missing helper exceptions
The `path` method on missing helper errors is inconsistent with the
implementation on LoadError in Ruby 2.0.  Wrap up the missing helper
exceptions so that the inconsistent behavior is mirrored in Ruby 2.0
(until we can figure out *why* it's inconsistent).
2012-06-14 09:01:58 -07:00
Aaron Patterson
5d50befa2e using hax to fix tests on Ruby 2.0 2012-06-13 18:01:16 -07:00
Akira Matsuda
099639670a Symbol responds_to :upcase & :downcase in Ruby >= 1.9 2012-06-06 19:33:38 +09:00
Vijay Dev
91305adef8 Merge branch 'master' of github.com:lifo/docrails 2012-05-23 23:26:39 +05:30
Vijay Dev
1ad0b378cc Revert "Remove blank trailing comments"
This reverts commit fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a.

Reason: Not a fan of such massive changes. We usually close such changes
if made to Rails master as a pull request. Following the same principle
here and reverting.

[ci skip]
2012-05-23 22:43:08 +05:30
Vijay Dev
2642c2961c copy edit[ci skip] 2012-05-23 22:42:49 +05:30
Alexey Vakhov
e4569b50d1 Add instance_accessor option to class_attribute 2012-05-22 00:28:34 +04:00
Henrik Hodne
fa6d921e11 Remove blank trailing comments
For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
with the first match, and voilà! Note that the regex matches a little bit too
much, so you probably want to `git add -i .` and go through every single diff
to check if it actually should be changed.
2012-05-20 01:29:13 +02:00
Henrik Hodne
7eb09aed87 Update documentation for AbstractController::Base 2012-05-20 00:50:22 +02:00
Francesco Rodriguez
e471aacf60 removing key argument from run_callbacks - fix build 2012-05-10 02:56:36 -05:00
Edward Tsech
b3bd01c154 Add annotaion for class_eval in AbstractController#helper_method [ci skip] 2012-05-08 11:08:15 +02:00
Edward Tsech
e8d1f10ac4 Improve readability of metaprogramming annotations at AbstractController callbacks. 2012-05-08 09:05:38 +02:00
Vijay Dev
b653c29bbe avoid empty api pages 2012-04-08 01:56:41 +05:30
José Valim
dd0275e463 Add a test case for layout nil. 2012-03-28 23:06:52 +04:00
José Valim
39514af7e7 Merge pull request #5480 from drogus/rendering-issues
Fix for #5440
2012-03-17 11:24:19 -03:00
Piotr Sarnacki
fc6b961b09 Merge pull request #5365 from avakhov/ac-layouts-excpetion-msgs
Fix exceptions messages in AC layouts
2012-03-16 03:25:09 -07:00
Luke Gruber
aca6937760 allow zero-arity proc for AbstrController::layout
proc without parameters can now be given to
AbstractController::layout
2012-03-15 16:40:23 -04:00
Vijay Dev
ab1b352a1c Merge pull request #5421 from parndt/master
Added missing 'end' to documentation example
2012-03-14 05:32:32 -07:00
Philip Arndt
9e8a938047 Added missing end to example 2012-03-14 10:11:55 +13:00
Vijay Dev
800c70a8f9 Merge branch 'master' of github.com:lifo/docrails 2012-03-13 23:29:30 +05:30
Santiago Pastorino
4751a699c9 AbstractController.action_methods should return a Set 2012-03-10 18:37:30 -02:00
Alexey Vakhov
c16f4f1f38 Fix exceptions messages in AC layouts 2012-03-10 09:57:50 +04:00
Alexey Vakhov
23c4efbb5b Fix layout method doc formatting 2012-03-10 09:45:13 +04:00
Alexey Vakhov
2562404624 Fix comment about layout folders lookup 2012-03-09 19:32:43 +04:00
Vijay Dev
7c90d91c3c Clean up module docs [ci skip]
Removed some useless docstrings and no-doc'ed some.
2012-03-07 01:04:14 +05:30
Alexey Vakhov
b27c29ef4a Fix layout lookup for anonymous controller 2012-02-28 14:42:57 +04:00
Vijay Dev
1e25d6217c Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionmailer/CHANGELOG.md
2012-02-25 21:52:59 +05:30
Alexey Vakhov
9e1b2d8174 Remove skip_filter block param 2012-02-23 11:25:31 +04:00
Ruben Fonseca
c0ec40c83a Refactored two methods to use delete with a block 2012-02-21 17:04:22 +00:00
Alexey Vakhov
eb26af6dd3 Fix AbstractController#controller_path doc 2012-02-19 11:47:39 +04:00
Alexey Vakhov
774e2c4d9c Fix AbstractController::Base#hidden_actions comment 2012-02-18 11:58:53 +04:00
José Valim
b41ef0a448 Merge pull request #4866 from bogdan/terminate_after_callbacks
AS::Callbacks#define_callbacks: add :terminate_after_callbacks option
2012-02-04 02:53:47 -08:00
Bogdan Gusiev
7661955634 AS::Callbacks: :skip_after_callbacks_if_terminated option 2012-02-03 17:57:53 +02:00
Bogdan Gusiev
1c61f7e6cb AC::Callbacks: remove usage of :per_key option from filters 2012-02-03 14:27:15 +02:00
Sergey Nartimov
5215eed5a3 Symbol#[] method presents in Ruby 1.9 2012-01-07 15:30:36 +03:00
Sergey Nartimov
7d862359d0 get rid of using instance_variable_names method from AS
- instance_variables return symbols in 1.9
- there is instance_variable_defined? method
2012-01-07 14:44:47 +03:00
Rafael Mendonça França
ec28c4fb24 Use Kernel#Array instead of Array.wrap in view_paths 2012-01-05 17:08:18 -03:00
Rafael Mendonça França
1a163dcc41 Array.wrap is no longer needed in AbstractController::Callbacks 2012-01-05 16:48:40 -03:00
José Valim
e6bfcc21a8 Remove unecessary config_accessors. 2011-12-24 09:59:28 +01:00
José Valim
cae1768c6a Remove deprecated layout lookup. 2011-12-20 14:44:48 +01:00
Aaron Patterson
572c3d5178 * BufferedLogger is deprecated. Use ActiveSupport::Logger, or the logger
from Ruby stdlib.
2011-12-19 18:41:37 -08:00
Piotrek Okoński
5266eb9f61 Default relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"]. Fixes #3365 2011-12-12 17:11:07 +01:00
José Valim
ab30570b69 Fix extend -> include. 2011-12-09 21:42:18 +01:00
José Valim
5ad5215211 Deprecate implicit layout lookup in favor of inheriting the _layout config. 2011-12-09 07:20:55 +01:00
José Valim
67cc07e0c4 Just use the proc if there is a chance of layout lookup. 2011-12-08 16:51:47 +01:00
José Valim
239262fee0 Optimize layout lookup to avoid double calls. 2011-12-08 16:39:06 +01:00
José Valim
efc28a7f70 Some small optimizations and improvements to benchmark code. 2011-12-08 16:39:06 +01:00
Prem Sichanugrist
18ceed201b Allow layout fallback when using layout method
Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail.

For example, consider this snippet:

    class CarsController
      layout 'single_car', :only => :show
    end

Rails will use 'layouts/single_car' when a request comes in `:show` action, and use 'layouts/application' (or 'layouts/cars', if exists) when a request comes in for any other actions.
2011-12-06 21:16:29 -05:00
José Valim
fd86a1b6b0 Rely on a public contract between railties instead of accessing railtie methods directly. 2011-11-23 19:06:45 +00:00
Dalibor Nasevic
759906d512 Fixed stale doc in AbstractController::Layouts 2011-11-06 14:43:11 +01:00
Alexey Vakhov
d42d97d2e3 Fix comment in AbstractController callbacks 2011-10-06 10:39:37 +04:00
José Valim
5711a35ad8 Ensure default_asset_host_protocol is respected, closes #2980. 2011-10-05 02:08:02 +02:00
José Valim
6e8fe1bf02 TestCase should respect the view_assigns API instead of pulling variables on its own. 2011-10-02 11:29:13 +02:00
Xavier Noria
bf2b9d2de3 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	RELEASING_RAILS.rdoc
	actionpack/lib/sprockets/railtie.rb
	actionpack/test/template/sprockets_helper_test.rb
	activerecord/test/cases/calculations_test.rb
	railties/guides/source/3_1_release_notes.textile
	railties/guides/source/active_resource_basics.textile
	railties/guides/source/command_line.textile
2011-08-13 16:30:07 -07:00
geemus
53e1a9d411 update abstract_controller callbacks to document meta-programmed filters 2011-08-13 16:22:35 -07:00
Santiago Pastorino
5b5b22acb5 Remove unused use_sprockets config 2011-08-13 16:22:15 -07:00
Aaron Patterson
5f56db4454 adding missing require to fist railties tests 2011-08-09 14:54:56 -07:00
Aaron Patterson
f9f423fa18 deprecating process_view_paths 2011-08-09 12:10:25 -07:00
Aaron Patterson
3ad26c8e48 avoid object creation via useless duping and freezing 2011-08-09 11:41:06 -07:00
Aaron Patterson
88de343ef4 Array#+ automatically dups, no double duping 2011-08-09 10:54:05 -07:00
Santiago Pastorino
cb85d70d61 Remove unused use_sprockets config 2011-07-25 19:07:39 -03:00
Jon Leighton
fcbde454f6 Don't do remove_possible_method when delegate is used. Two reasons: 1) warnings should be shown, and fixed at the source and 2) the code is slow. Fixes #1937. 2011-07-18 00:22:26 +01:00
Matt Jankowski
db4f0ac025 use present tense on examples 2011-06-21 15:12:11 -04:00
Matt Jankowski
538d2a52ce remove extra space and clarify how an exception is made for controller wide layouts 2011-06-21 10:34:31 -04:00
Matt Jankowski
20a9bddfad reorder layout selection examples to occur in the order that the code does, and provide more detail on why each selection is made 2011-06-21 10:31:16 -04:00
Sebastian Martinez
fcdb5dc557 Remove extra white spaces on ActionPack docs. 2011-05-23 20:22:33 -03:00
Xavier Noria
d491130236 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionpack/lib/action_view/helpers/date_helper.rb
	railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
2011-05-14 11:21:27 +02:00
Xavier Noria
e5524d538c minor edits after going through what's new in docrails 2011-05-14 11:15:43 +02:00
Nick Sutterer
e3b3f416b5 added docs for AbC::UrlFor and AC::UrlFor. 2011-05-12 09:31:36 +02:00
Sebastian Martinez
9899f53184 better styling on #available_action? docs 2011-05-06 14:23:25 -03:00
José Valim
9c2c25c1a1 Revert to old semantics, use available_action? instead of action_method?. 2011-05-06 18:44:18 +02:00
José Valim
d42bb68430 More updates to ivars list. 2011-05-06 14:57:25 +02:00
José Valim
894bdbd53d Move variables to underscore format, update protected instance variables list. 2011-05-06 14:57:25 +02:00
José Valim
1632a3a49f More AV::Base cleanup. 2011-05-04 12:07:37 +02:00
José Valim
6afc900191 Move prefixes to view paths as they are now a lookup context dependency. 2011-05-04 11:28:37 +02:00
José Valim
c9fa3f03fe Also allow prefixes as third argument to lookup context. 2011-05-04 09:07:11 +02:00
Nick Sutterer
eb327c1bab no @controller dependency in Renderers. 2011-05-04 00:12:11 +02:00
Nick Sutterer
65ceccb0ba controller's prefixes are now added to LookupContext. 2011-05-03 23:41:38 +02:00
José Valim
f9849070ac Add a shared entry point for AV and AC render which can be used as extension in the future. 2011-05-03 16:51:47 +02:00
José Valim
b735761385 Introduce view renderer. 2011-05-01 13:40:13 +02:00
Piotr Sarnacki
d4bea35f1a Make ActionController::Base.modules_for_helpers and ActionController::Base.all_helpers_from_path public methods 2011-04-25 15:02:41 +02:00
José Valim
a66c917235 Do not inherit from Rack::Response, remove a shit-ton of unused code. 2011-04-19 11:54:12 +02:00
José Valim
4f044528c0 Slightly reorganize rendering stack. 2011-04-18 08:12:51 +02:00
José Valim
d6bd606bdd render :once, YAGNI. 2011-04-15 21:11:54 +02:00
Eric Hayes
ada550d908 Fixed a comment typo 2011-04-14 16:29:06 +08:00
Prem Sichanugrist
0f8a6ebba3 Fix missing requires in Action Mailer
This made the isolated test failed on CI server.

Signed-off-by: Xavier Noria <fxn@hashref.com>
2011-04-13 19:52:19 +02:00
Joshua Peek
ed24595647 Merge branch 'master' into sprockets 2011-04-12 21:56:00 -05:00
Oge Nnadi
d5634b2287 Added missing </tt> 2011-04-11 13:08:58 -07:00
Santiago Pastorino
cc58fe79ac Implicit actions named not_implemented can be rendered 2011-04-02 23:47:50 -03:00
Joshua Peek
56a5da89db Merge branch 'master' into sprockets
Conflicts:
	railties/lib/rails/application/configuration.rb
2011-03-30 21:04:33 -05:00
Joshua Peek
5df076ad09 Merge branch 'master' into sprockets 2011-03-30 20:56:05 -05:00
José Valim
ba51aa0b1b Make action_method? public and change implicit rendering to override it instead. 2011-03-30 17:22:05 +02:00
Joshua Peek
bed7a1acc4 Copy use_sprockets config 2011-03-29 16:17:49 -05:00
José Valim
94907035b6 Pass the proper method_name instead of hardcoding to action_name.
Conflicts:

	actionpack/lib/action_controller/metal/implicit_render.rb
2011-03-29 19:30:59 +02:00
Andrew White
9772de8d45 Fix filter :only and :except with implicit actions
The method_name argument is "default_render" for implicit actions
so use the action_name attribute to determine which callbacks to run.

[#5673 state:resolved]
2011-03-23 23:32:44 +00:00
Manuel Meurer
deae670e9a Change ActionView::ViewPathSet to ActionView::PathSet 2011-03-13 15:14:51 +07:00
Neeraj Singh
806e6f80dc render_to_string must ensure that response_body
is nil

[ #5875 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-01-25 20:14:03 +01:00
José Valim
262b2ea8cd Solve SystemStackError when changing locale inside ActionMailer [#5329 state:resolved] 2011-01-19 23:42:10 +01:00
Nick Sutterer
db24701abe process_action accepts multiple args, even with Callbacks. 2010-12-29 16:37:10 -08:00
wycats
e03e1fdbc8 Speed up template inheritance and remove template inheritance option 2010-12-26 23:56:09 -08:00
artemave
ce21ea7832 #948 make template inheritance optional 2010-12-26 22:32:15 -08:00
artemave
ddd85ef9c6 #948 template_inheritance 2010-12-26 22:32:15 -08:00
Neeraj Singh
3c7a33c051 Rewording existing comment 2010-11-30 10:00:47 -05:00
Neeraj Singh
aa9a3227a0 Rewording existing comment 2010-11-29 21:38:59 -05:00
Santiago Pastorino
d3f8765482 Avoid range object creation 2010-11-20 02:29:57 -02:00
Santiago Pastorino
bb7b705b0c Fix indentation 2010-11-19 14:26:44 -02:00
Santiago Pastorino
555b7cd04a Don't merge just directly add to the action to the :partial key 2010-11-19 14:26:42 -02:00
Santiago Pastorino
b1ffd65b8f Useless assignation 2010-11-19 14:26:39 -02:00
José Valim
a897402863 Remove inline comment. 2010-11-11 17:07:06 +01:00
Marcelo Giorgi
2bb1c202b4 Make after_filter halt when before_filter renders or redirects [#5648 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-11 17:05:07 +01:00
Andrew White
4ba24ba043 Allow generated url helpers to be overriden [#5243 state:resolved] 2010-10-26 14:27:18 +01:00
José Valim
940b57789f Add support to render :once.
This will be used internally by sprockets to ensure requires are executed just once.
2010-10-10 12:43:26 +02:00
wycats
8cb2cfbf71 Fix a few bugs when trying to use Head standalone 2010-10-10 00:54:11 -07:00
José Valim
c563f10f3e render :template => 'foo/bar.json' now works as it should. 2010-10-07 21:31:31 +02:00
José Valim
8f9e9118e4 Make collection rendering faster. 2010-10-07 21:31:31 +02:00
Aaron Patterson
1d9a219307 oops, missed a uniq 2010-09-29 11:53:34 -07:00
Aaron Patterson
a5f8f59081 dry up action_methods 2010-09-29 11:47:54 -07:00
Aaron Patterson
c57f5d58ea no need to call e.class 2010-09-29 10:39:17 -07:00
José Valim
258f7b586e Fix a small typo (ht: masterkain) 2010-09-29 10:34:37 -07:00
José Valim
14f9904e0f Avoid (@_var ||= nil) pattern by using initialize methods and ensuring everyone calls super as expected. 2010-09-29 11:18:31 +02:00