Commit Graph

1548 Commits

Author SHA1 Message Date
Jeremy Kemper
eb256718c3 Remove send! usage, relic of reverted 1.9 behavior 2008-07-28 13:54:10 -07:00
Joshua Peek
19db0b7324 Added back ActionController::Base.allow_concurrency flag and moved lock down to controller processing. 2008-07-28 14:31:40 -05:00
Joshua Peek
a5db148825 Prepare Route#generate and Route#recognize early. Also refactor segments a bit to try to make immutable. 2008-07-28 13:41:42 -05:00
Joshua Peek
e0513e33c4 Routing whitespace cleanup 2008-07-28 13:38:20 -05:00
Pratik Naik
6e75455125 Merge docrails changes 2008-07-28 12:33:24 +01:00
Joshua Peek
f48b9ab5c2 ActionController::Base.relative_url_root falls back to ENV['RAILS_RELATIVE_URL_ROOT'] 2008-07-24 14:06:22 -05:00
Joshua Peek
a87462afcb AbstractRequest.relative_url_root is no longer automatically configured by a HTTP header. It can now be set in your configuration environment with config.action_controller.relative_url_root 2008-07-24 13:41:51 -05:00
Joshua Peek
bc5896e708 Memoize ActionView::Base pick_template and find_partial_path for rendering duration 2008-07-22 10:27:32 -05:00
Tom Ward
d39485078e Raise ArgumentError if an invalid method is specified as part of a route's conditions. Also raise an error if HEAD is specified as the method, as rails routes all HEAD requests through the equivalent GET, though doesn't return the response body [#182 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-07-18 20:19:03 -05:00
Jeremy Kemper
57a2780f14 etag! and last_modified! conditional GET helpers 2008-07-17 23:18:10 -07:00
Joshua Peek
cd63015570 All 2xx requests are considered successful [#217 state:resolved] 2008-07-16 19:49:46 -05:00
Ripta Pasay
f7fdbae770 Use fully-qualified controller name when logging. [#600 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-17 01:33:44 +01:00
Pratik Naik
90c930f45c Allow Dispatcher exceptions to be handled in application.rb using rescue_from 2008-07-16 18:54:08 +01:00
Pratik Naik
0432d15164 Merge with docrails. 2008-07-16 13:01:23 +01:00
Pratik Naik
1d002f6bcb Make RackRequest#request_method respect _method 2008-07-16 05:02:29 +01:00
Pratik Naik
5cc3ea6969 RackResponse should not contain Status header 2008-07-16 04:17:28 +01:00
Pratik Naik
0f8206104e RackRequest#content_type should return Mime::Type 2008-07-16 03:18:35 +01:00
Joshua Peek
aca246ab25 Get buffer for fragment cache from template's @output_buffer 2008-07-15 14:43:52 -05:00
Jeremy Kemper
2167f95d85 Restore the more readable before_ and after_filters methods since they aren't called frequently 2008-07-14 10:11:53 -07:00
Joshua Peek
26bc867151 Small tweak to e0fef66 2008-07-13 14:00:40 -05:00
Joshua Peek
e0fef66149 Made ActionView::Base#first_render a little more private. And added _last_render to track the most recent render. Will fix #609 as a side effect. [#609 state:resolved] 2008-07-13 13:26:48 -05:00
Joshua Peek
99cc85bc09 Set config.action_view.warn_cache_misses = true to receive a warning if you perform an action that results in an expensive disk operation that could be cached 2008-07-12 15:31:50 -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
Michael Koziarski
e53f5fe696 Restore support for partial matches in assert_redirected_to
If both the actual redirection and the asserted redirection are hashes, succeed if the asserted redirection is a strict subset of the actual redirection.
2008-07-12 11:42:41 +02:00
Clemens Kofler
feb08984ea Added notes to Routing documentation and routes.rb regarding defaults routes opening the whole application for GET requests
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-07-10 09:29:27 +02:00
Jeremy Kemper
d37e641336 Move accept header parsing shortcut to Mime::Type.parse 2008-07-09 11:30:18 -07:00
Jeremy Kemper
0ce7fe5308 Don't repeatedly convert only/except options 2008-07-09 10:42:30 -07:00
Cheah Chu Yeow
ce4a1bb853 Remove some Symbol#to_proc usage in runtime code. [#484 state:resolved] 2008-07-09 10:42:30 -07:00
Jeremy Kemper
f82bd31cb0 Request#accepts special-cases a single mime type 2008-07-09 10:42:30 -07:00
Michael Koziarski
4ce9931f4f Reenable the use of the Accept header to give people a chance to update their applications and provide feedback. 2008-07-09 18:36:15 +02:00
Cheah Chu Yeow
96708af6a5 Ensure url_for(nil) falls back to url_for({}). [#472 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-09 13:02:14 +01:00
Michael Koziarski
2f4aaed7b3 Disable the Accept header by default
The accept header is poorly implemented by browsers and causes strange errors when used on public sites where crawlers make requests too.  You should use formatted urls (e.g. /people/1.xml) to support API clients. Alternatively to re-enable it you need to set:

config.action_controller.use_accept_header = true

A special case remains for ajax requests which will have a javascript format for the base resource (/people/1) if the X-Requested-With header is present.  This lets ajax pages still use format.js despite there being no params[:format]
2008-07-07 07:31:49 +02:00
Jeremy Kemper
271f5b655f Fix rdoc for Filters::ClassMethods 2008-07-04 12:51:16 -07:00
Michael Koziarski
c3aaba0180 Simplify the implementation of assert_redirected_to to normalise the urls before comparing. Also allows for a simpler implementation of redirect_to without most of the recursion.
Also allows for assert_redirected_to @some_record
2008-07-04 10:41:40 +03:00
Michael Koziarski
db58391079 Remove old broken follow_redirect from functional tests. Still works in integration tests.
The follow_redirect in functional tests only worked if you used redirect_to :id=>foo, :action=>bar, rather than named routes.
2008-07-04 10:41:40 +03:00
josevalim
bad1eac91d Allow caches_action to accept cache store options. [#416 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-04 02:00:51 +01:00
Joshua Peek
1a478923dc Reduce the number of callsites for new TemplateFiles 2008-07-03 14:01:45 -05:00
Michael Koziarski
12cf8f348b Move template_format logic out to the request so it's alongside the 'regular' request format.
Use xhr? instead of the expensive trip through Request#accepts.
2008-07-03 19:43:06 +03:00
Michael Koziarski
df36a6f759 Remove unneeded ObjectWrapper class.
Was previously needed to work around the semantics of a deprecated (now removed) API to render :partial
2008-07-03 19:26:56 +03:00
Tarmo Tänav
a37d065f85 Use :namespace instead of :path_prefix for finding controller. [#544 state:resolved]
:namespace is supposed to be the module where controller exists.
:path_prefix can contain anything, including variables, which
makes it unsuitable for determining the module for a controller.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-03 16:11:50 +01:00
Joshua Peek
3b3790a435 Deprecate :use_full_path render option. The supplying the option no longer has an effect. 2008-07-02 21:38:58 -05:00
Mike Subelsky
8f640c381d Added application/jsonrequest as a synonym for application/json
[#536 state:resolved]
2008-07-02 11:39:42 -07:00
Pratik Naik
2b43620e3c Add :as option to render a collection of partials with a custom local variable name. [#509 state:resolved] [Simon Jefford, Pratik Naik] 2008-07-02 16:40:42 +01:00
Tim Haines
f5052dd8a3 Make sure render :template works with :locals. [#524 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-02 04:30:34 +01:00
Joshua Peek
aff2d33172 Improved test coverage and added RackRequest support for CGI environment variables. 2008-07-01 21:53:55 -05:00
Joshua Peek
a9259ccfe0 Hide InlineTemplate class from ActionController and use ActionView's render API 2008-06-25 06:04:06 -05:00
Joshua Peek
ad772402c4 Made ActionView::Base#render_file private 2008-06-25 05:57:24 -05:00
Jimmy Baker
670e22e372 Patched HTML::Document#initialize call to Node.parse so that it includes the strict argument. [#330] 2008-06-24 23:11:35 -07:00
Jeremy Kemper
69e72af622 Improve readability 2008-06-24 11:53:49 -07:00
Tammer Saleh
bb6e8eea5a Fixed polymorphic_url to be able to handle singleton resources.
Example usage:
polymorphic_url([:admin, @user, :blog, @post]) # => admin_user_blog_post_url(@user, @post)

[#461 state:resolved]
2008-06-22 18:58:47 -07:00