Commit Graph

1534 Commits

Author SHA1 Message Date
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
rick
10c581a6de fix merge 2008-06-19 09:59:36 -07:00
Joshua Peek
bec4b69a3b Replaced TemplateFinder abstraction with ViewLoadPaths 2008-06-17 21:21:07 -05:00
Luke Redpath
7650ff892c Fix url_for with no arguments when default_url_options is not explicitly defined. [#339 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-06-17 20:53:41 +01:00
Amos King
1b4b8fbbd9 verify :redirect_to => :back should redirect to the referrer. [#280 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-06-17 18:08:56 +01:00
Andrew Kaspick
322f3eacf9 Correct code example in dom_id docs. [#437 state:resolved] 2008-06-17 00:32:37 -07:00
Jeremy Kemper
eab71208db Performance: integration test benchmarking and profiling. [Jeremy Kemper] 2008-06-14 02:04:38 -07:00
Pratik Naik
eea4fe4c90 Make rescue template xhtml compatible [Sam Ruby] [#415 status:resolved] 2008-06-13 23:23:44 +01:00
David Heinemeier Hansson
6573f6a4bc Revert "Lazy load cache and session stores"
This reverts commit 19895f087c.
2008-06-12 19:52:33 -05:00
Jonathan del Strother
3e07f320c1 Improve ActionCaching's format-handling
Make ActionCaching more aware of different mimetype formats.
It will now use request.format to look up the cache type, in addition to the path extension.
When expiring caches, the request format no longer affects which cache is expired.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-06-11 13:15:01 +01:00
Pratik Naik
f728e57d22 Make sure cache_template_loading works and don't use to_prepare callback 2008-06-11 09:36:41 +01:00
Joshua Peek
e8a0ba4c93 Ensure view path cache is rebuilt in production mode which was broke by df44df9. 2008-06-10 20:39:02 -05:00
Pratik Naik
19895f087c Lazy load cache and session stores 2008-06-10 10:29:25 +01:00
Joshua Peek
df44df945d Ensure ActionView::TemplateFinder view cache is rebuilt on initialize. 2008-06-08 22:31:54 -05:00
Joshua Peek
0c9281e821 Drop ActionController::Base.allow_concurrency flag 2008-06-08 22:11:50 -05:00