Michael Koziarski
9fdb15e60f
Change the forgery token implementation to just be a simple random string.
...
This deprecates the use of :secret and :digest which were only needed when we were hashing session ids.
2008-11-23 14:28:34 +01:00
Luke Melia
60d6f25517
Fix rendering html partial via inline render when with :js format [ #1399 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2008-11-18 15:19:16 -06:00
Luke Melia
75fb8dfb99
Prevent assert_template failures when a render :inline is called before rendering a file-based template [ #1383 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2008-11-17 22:09:22 -06:00
Jeremy Kemper
c82e8e1f48
Move controller assertions from base TestCase to AC:: and AV::TestCase
2008-11-07 15:42:34 -05:00
David Heinemeier Hansson
cbeac93310
Added render :js for people who want to render inline JavaScript replies without using RJS [DHH]
2008-11-01 12:03:49 +01:00
Joshua Peek
2092687bcb
Ensure content type gets reset after render_to_string [ #1182 state:resolved]
2008-10-30 15:26:29 -05:00
David Heinemeier Hansson
18542c9e00
Dont try to auto-set the etag based on the body if any freshness headers have already been set [DHH/José Valim]
2008-10-21 16:58:12 +02:00
David Heinemeier Hansson
448e7e7c04
Let fresh_when actually do the head(:not_modified). Cleaner and we get the filter halting for free then.
2008-10-21 02:54:55 +02:00
David Heinemeier Hansson
9acb88e666
Added stale?/fresh? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends [DHH]
2008-10-21 02:30:13 +02:00
Michael Koziarski
aec391621b
Make sure last_modified! works with <= rather than just equality.
2008-10-07 21:09:07 +02:00
Michael Koziarski
0eefa7058a
Fix etag! and last_modified! to work as advertised.
...
Add tests too.
2008-09-30 17:00:38 +02:00
Jonathan del Strother
6cfb70023a
Don't set Content-Length on 304 responses
...
Commit 8aad8c claimed to do this, but it checks for the 304 status too early, before handle_conditional_get! has overridden it.
[#958 state:resolved]
Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv >
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2008-09-02 22:57:40 +02:00
Pratik Naik
56c2b02f59
Fix AM tests and add tests for rendering logging
2008-08-31 16:29:21 +01:00
Pratik Naik
4fb75392aa
Add test to make sure RJS block inside controller is executed in view context
2008-08-30 21:47:35 +01:00
Joshua Peek
a200c67611
Merge RenderTest and NewRenderTest
2008-08-29 13:26:28 -05:00
Ryan Bates
a8ece12fe2
Return nil instead of a space when passing an empty collection or nil to 'render :partial' [ #791 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2008-08-19 19:09:04 -05:00
Jeremy Kemper
ba2d61dd81
Update tests for request memoization
2008-08-08 02:31:12 -07:00
Jeremy Kemper
b7529ed1cc
Simplifying usage of ETags and Last-Modified and conditional GET requests
2008-08-07 23:43:12 -07:00
Tom Ward
c3d1fda555
Set the response content type to that of found template if not explicitly set elsewhere [ #444 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2008-07-18 20:14:12 -05:00
Jeremy Kemper
57a2780f14
etag! and last_modified! conditional GET helpers
2008-07-17 23:18:10 -07:00
Michael Koziarski
24a8ae4e08
Try to get more useful errors out of the test_line_offset failures
2008-07-15 20:39:36 +02:00
Joshua Peek
30204c4e66
Set global ActionController::Base.view_paths for test cases
2008-07-12 14:11:51 -05:00
Michael Koziarski
efd18066a2
Tighten the rescue clause here to prevent hiding strange mock related errors behind the line offset test
2008-07-03 19:21:04 +03:00
Joshua Peek
339491a6b3
Set precompiled fixture load path constant to speed up tests
2008-06-25 15:24:12 -05:00
Pratik Naik
74436d2203
Fixed render :template for templates in top level of view path. [ #54 state:resolved]
2008-05-01 10:21:46 +01:00
Michael Koziarski
46356100d1
Make sure render :update support the options hash. Closes #11088 [ernesto.jimenez]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-12 22:42:36 +00:00
Michael Koziarski
692dbbf793
Introduce a Template class to ActionView. Closes #11024 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8805 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-06 04:26:40 +00:00
Michael Koziarski
aecb7fbefc
Correct line numbers from template errors. Closes #10937 [Aleksey Kondratenko]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-27 20:48:13 +00:00
Michael Koziarski
61c90a4ad6
Reapply the TemplateFinder first applied in [8669] then reverted in [8676]. Closes #10800 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8683 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 20:45:04 +00:00
Jeremy Kemper
ca4c7ab362
Support render :text => nil. Closes #6684 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8577 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-06 20:52:57 +00:00
Jeremy Kemper
9d755f1983
require abstract_unit directly since test is in load path
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:06 +00:00
Jeremy Kemper
2f61985540
Mark that render tests crash Ruby 1.9
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8410 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 02:29:45 +00:00
Jeremy Kemper
bafd698acb
render :xml and :json preserve custom content types. Closes #10388 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8342 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-09 22:11:37 +00:00
Michael Koziarski
12d8d48b71
Refactor the default rendering out to a method called default_render to provide a hook for plugin authors. Closes #9953 [cjheath]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8011 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-25 06:38:01 +00:00
Jeremy Kemper
0ee1cb2cd3
Ruby 1.9 compat, consistent load paths
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-02 05:32:14 +00:00
David Heinemeier Hansson
7275d2749c
Fixed JSON encoding to use quoted keys according to the JSON standard ( closes #8762 ) [choonkat/chuyeow]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7697 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 20:57:50 +00:00
Michael Koziarski
f81dae3fca
Remove deprecated functionality from actionpack. Closes #8958 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-03 00:18:30 +00:00
Michael Koziarski
55f444e694
Send freshness information when sending Etags. Without this internet explorer will not send conditional gets for a resource, but instead hold on to the responses for the current browser session.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-12 22:32:19 +00:00
Michael Koziarski
b549366216
Introduce fake_models.rb to avoid platform-specific code. [mpalmer] Closes #8714
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7190 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-17 09:44:03 +00:00
Rick Olson
a450e769f1
Allow you to render views with periods in the name. Closes #8076 [norbert]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-01 00:04:03 +00:00
Rick Olson
b83efadb32
Assume html format when rendering partials in RJS. #8076 [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6950 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-05 16:51:49 +00:00
Rick Olson
fa3618d375
add test case for js.erb partials on *.js formatted requests
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 03:15:36 +00:00
Rick Olson
80074cb4de
Assume that rendered partials go by the HTML format by default
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6734 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 03:13:32 +00:00
David Heinemeier Hansson
82d70d1d16
Added that render :xml will try to call to_xml if it can [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6574 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-24 18:29:37 +00:00
David Heinemeier Hansson
5208d8d817
Added :location option to render so that the common pattern of rendering a response after creating a new resource is now a 1-liner [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-24 17:52:03 +00:00
Rick Olson
6351e0a541
The default respond_to blocks don't set a specific extension anymore, so that both 'show.rjs' and 'show.js.rjs' will work. [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6517 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-12 20:25:32 +00:00
Rick Olson
da6f5a1cb4
Change ActionView template defaults. Look for templates using the request format first, such as show.html.erb or show.xml.builder, before looking for the old defaults like show.erb or show.builder [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-02 00:02:11 +00:00
David Heinemeier Hansson
94fa0ed053
Its ETag not Etag
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 02:10:19 +00:00
David Heinemeier Hansson
7ec0204ecd
Move etagging down to response, so renders with layouts dont screw it up [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6165 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 00:27:19 +00:00
David Heinemeier Hansson
aad7fbde68
Added caching option to AssetTagHelper#stylesheet_link_tag and AssetTagHelper#javascript_include_tag [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 23:54:20 +00:00