Commit Graph

6553 Commits

Author SHA1 Message Date
Piotrek Okoński
5266eb9f61 Default relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"]. Fixes #3365 2011-12-12 17:11:07 +01:00
Lennart Fridén
dc43e402a1 Added :use_two_digit_numbers option [Lennart Fridén & Kim Persson]
Added use_two_digit_numbers select_tag option for displaying months and days with leading zeros without affecting the values (useful for e.g. ISO-style dates, 2011-08-01).

Signed-off-by: José Valim <jose.valim@gmail.com>

Conflicts:

	actionpack/CHANGELOG.md
2011-12-11 22:54:28 +01:00
José Valim
78de996562 Merge pull request #3933 from wfarr/master
Add button_tag support to ActionView::Helpers::FormBuilder
2011-12-11 06:06:41 -08:00
Will Farrington
3f65e7f7be Add button_tag support to ActionView::Helpers::FormBuilder.
This support is near-identical to the existing submit_tag support.

Example:

    <%= form_for @post do |f| %>
      <%= f.button %>
    <% end %>
2011-12-11 08:56:26 -05:00
Guillermo Iguaran
7a7e87d5aa Use ProcessedAsset#pathname in Sprockets helpers when debugging is on. Closes #3333 #3348 #3361.
Is wrong use ProcessedAsset#to_s since it returns the content of the file.
2011-12-10 18:08:42 -05:00
Piotr Sarnacki
efed2d56e2 Update partials documentation, partial_path is no longer generated using RecordIdentifier 2011-12-10 01:30:21 +01:00
José Valim
ab30570b69 Fix extend -> include. 2011-12-09 21:42:18 +01:00
David Heinemeier Hansson
22a6079a20 Make ActiveSupport::Benchmarkable a default module for ActionController::Base, so the #benchmark method is once again available in the controller context like it used to be *DHH* 2011-12-09 18:17:57 +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
2995134cba Simplify path traversal logic 2011-12-09 06:25:10 +01:00
Aaron Patterson
2c471b3ac8 load the encoding converter to work around [ruby-core:41556] when switching encodings 2011-12-08 15:14:07 -08:00
José Valim
d4d99bbc87 Fix another regression related to the layout optimization. 2011-12-08 22:56:50 +01:00
José Valim
c41f08cefe Move symbolize keys to the inner options as we can assume url_options will be properly symbolized. 2011-12-08 21:20:47 +01:00
José Valim
ebd71fd0e3 Fix a regression and also fix broken test. 2011-12-08 21:00:34 +01:00
José Valim
7280787a53 Improve cache on route_key lookup. 2011-12-08 19:53:16 +01:00
José Valim
859a4556dd Revert accidental change from cattr_accessor to class_attribute. 2011-12-08 19:01:15 +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
José Valim
bf34a360dd Merge pull request #3900 from jfturcot/accessible_wrap_params
ParamsWrapper only wrap the accessible attributes when they were set
2011-12-08 01:13:14 -08:00
José Valim
e2e9eabc58 Remove dead broken code from AD::Request 2011-12-08 09:30:27 +01:00
José Valim
f84bf83b9b Merge pull request #3888 from kennyj/should_use_default_charset
Assign config.encoding to AD::Response.default_charset at the initialization time.
2011-12-08 00:18:09 -08:00
Jean-Francois Turcot
d5526218e4 ParamsWrapper only wrap the accessible attributes when they were set 2011-12-07 22:50:01 -05:00
José Valim
30f0d7bac8 Remove #:nodoc: from partial renderer. 2011-12-07 19:16:14 +01:00
kennyj
0a958d8468 Use freezed string constant. Some string literals is used repeatedly. 2011-12-08 02:19:15 +09:00
José Valim
0df2ef3ef4 Merge pull request #3884 from sikachu/master-fix_layout
Allow layout fallback when using `layout` method
2011-12-07 08:00:45 -08:00
kennyj
199353c658 Assign config.encoding to AD::Response.default_charset at the initialization time. 2011-12-07 21:11:08 +09:00
José Valim
eb22901920 Merge pull request #3878 from kennyj/should_use_default_charset
Use default charset when we read content type without charset.
2011-12-07 04:07:51 -08:00
kennyj
a1986e7d55 Use default charset when we read content type without charset. 2011-12-07 12:35:44 +09: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
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
Vijay Dev
7eb596cddd Merge branch 'master' of github.com:lifo/docrails 2011-12-06 23:05:43 +05:30
Santiago Pastorino
e58d663f3e Merge pull request #3428 from adrianpike/asset_path_conflicts
Issue #3427 - asset_path_conflicts
2011-12-06 05:16:24 -08:00
Thomas von Deyen
0da31a1839 Allowing string as url argument for expire_action 2011-12-06 13:05:15 +01:00
Adrian Pike
25007ad3fb Let's do the same trick for asset_path that we do for [image,javascript,stylesheet]_path to avoid namespace conflicts on named routes.
Closes #3427
2011-12-05 17:17:39 -08:00
Uģis Ozols
d645aed91f Use do end for multiline block. 2011-12-05 23:11:20 +02:00
Uģis Ozols
1c65962b9d .rhtml and .rxml was removed in Rails 3. 2011-12-05 20:40:48 +02:00
José Valim
f6cc4fd7a2 Merge pull request #3861 from andyjeffries/master
Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)
2011-12-05 08:48:25 -08:00
lest
1f0e21ce30 use classify in ParamsWrapper to derive model name from controller name 2011-12-05 19:15:36 +03:00
Andy Jeffries
71d769e3b5 Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match) 2011-12-05 15:41:38 +00:00
Overbryd
9fb5ee8beb Minor enhancement by not unnecessarely escaping forward slashing within a curly regexp and by mentoining the protocol relative scheme in the internal comment 2011-12-05 11:48:05 +01:00
Overbryd
e31c4ace97 Fix for redirect_to to respect urls with a network path reference like "//asset.host.com/resources/1235" see issue #3856 2011-12-05 11:19:48 +01:00
Vasiliy Ermolovich
e29773f885 form_for with +:as+ option uses "action_as" as css class and id 2011-12-04 22:12:24 +03:00
José Valim
2ab2077235 Fix failing cascade exception. 2011-12-03 11:38:25 +01:00
José Valim
76a3ec7f6e Try to play nice with plugins doing monkey patches. 2011-12-02 09:57:43 +01:00
José Valim
07f90f6bec Merge branch 'exceptions' with the following features:
* A Railtie API for registering new exceptions and their respective status code (check Active Record railtie for an example)

* Extraction of ShowExceptions middleware logging and debugging features into a middleware called DebugExceptions

Conflicts:
	actionpack/CHANGELOG.md
2011-12-01 21:18:47 +01:00
José Valim
f9edc079e0 Split and improve show and debug exceptions middlewares. 2011-12-01 21:15:42 +01:00
José Valim
750bb5c865 Split ShowExceptions responsibilities in two middlewares. 2011-12-01 20:46:18 +01:00
David Heinemeier Hansson
83d29a283c Revert "Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack"
Needless indirection with no added value.

This reverts commit 535853e83b.
2011-12-01 20:45:47 +01:00
José Valim
956ecff833 Add a deprecation to old show exceptions API (even though it was not public). 2011-12-01 20:16:12 +01:00