Commit Graph

3801 Commits

Author SHA1 Message Date
Sergey Nartimov
caa1c19787 fix separator insertion in date_select helper 2011-12-14 23:20:23 +03:00
José Valim
e3a4eb4b40 Close the response body on cascade pass, closes #3975. 2011-12-14 17:03:35 +01:00
choonkeat
5f67cfeda1 Fix url_for options[:subdomain] to allow objects as values
* e.g. blog_url(subdomain: current_user) instead of blog_url(subdomain: current_user.to_param)
2011-12-14 22:43:42 +08:00
José Valim
f3531a8fc9 Clean up details keys before some tests to expire the cache. 2011-12-14 09:23:34 +01:00
Sergey Nartimov
081431fdf1 log exception backtrace when all backtrace lines silenced 2011-12-13 22:32:39 +03:00
José Valim
0f4da5b393 Fix failing AP tests. 2011-12-13 15:45:16 +01:00
Aaron Patterson
810837dda8 use Array#join so that file encoding doesn't impact returned string.
Fixes #3957
2011-12-12 19:45:16 -08:00
José Valim
fa1d9a884c Speed up development by only reloading classes if dependencies files changed.
This can be turned off by setting `config.reload_classes_only_on_change` to false.

Extensions like Active Record should add their respective files like db/schema.rb and db/structure.sql to `config.watchable_files` if they want their changes to affect classes reloading.

Thanks to https://github.com/paneq/active_reload and Pastorino for the inspiration. <3
2011-12-12 22:54:04 +01:00
José Valim
ede647a505 Allow reloader to be configured. 2011-12-12 19:41:17 +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
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
Aaron Patterson
c212a34e1d only load converter if the encodings are different 2011-12-09 09:33:36 -08:00
José Valim
5ad5215211 Deprecate implicit layout lookup in favor of inheriting the _layout config. 2011-12-09 07:20:55 +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
ebd71fd0e3 Fix a regression and also fix broken test. 2011-12-08 21:00:34 +01:00
kennyj
3ade2f8e89 Fix warning for params_wrapper_test. 2011-12-08 23:09:09 +09: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
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
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
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
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
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
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
6a4606d3a6 Remove unnecessary test setup. 2011-12-01 21:17:11 +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
David Heinemeier Hansson
535853e83b Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack 2011-12-01 19:47:14 +01:00
David Heinemeier Hansson
218c272938 Allow fresh_when/stale? to take a record instead of an options hash [DHH] 2011-12-01 19:16:10 +01:00
lest
565d92f578 fix method redefined warnings in tests 2011-11-30 18:57:12 +03:00
lest
a985309abc fix warning in tests when using render_erb helper 2011-11-30 18:05:23 +03:00
lest
e975fe710a test helpers in erb using erb 2011-11-30 17:38:09 +03:00
José Valim
38ab982cff Log 'Filter chain halted as CALLBACKNAME rendered or redirected' every time a before callback halts. 2011-11-30 09:53:09 +01:00
Jon Leighton
7af719e81c Deprecate set_sequence_name in favour of self.sequence_name= 2011-11-29 20:13:37 +00:00
Jon Leighton
0b72a04d0c Deprecate set_table_name in favour of self.table_name= or defining your own method. 2011-11-29 20:13:36 +00:00
Marc-Andre Lafortune
d3bc12b27f Handle correctly optional parameters for callable asset_host. 2011-11-29 02:01:18 -05:00
lest
fe7d4f09ef put backtrace_cleaner to env 2011-11-28 19:25:37 +03:00
Vasiliy Ermolovich
fb8b555c49 add namespace options to form_for
You can provide a namespace for your form to ensure uniqueness of id attributes on form elements.
The namespace attribute will be prefixed with underscore on the generate HTML id
2011-11-27 23:41:23 +03:00
lest
bc81ba2451 fix label with block in erb 2011-11-27 16:59:44 +03:00
José Valim
0a4035b12a Revert the serializers API as other alternatives are now also under discussion 2011-11-25 19:29:39 +00:00
José Valim
6f5fdf8179 Merge pull request #3747 from lest/middleware-logger
middlewares should have configurable logger
2011-11-25 05:33:26 -08:00