Commit Graph

3424 Commits

Author SHA1 Message Date
Jeremy Kemper
5577d561f9 Merge branch 'master' of git@github.com:rails/rails 2009-04-26 15:18:51 -07:00
Jeremy Kemper
8d64085138 Only Object to_json alias is needed. Prefer nil options. 2009-04-26 15:18:33 -07:00
Jeremy Kemper
be7e21a85c Qualify toplevel constant references since we're in a BasicObject 2009-04-26 15:05:50 -07:00
Joshua Peek
0494909679 Inherit TestSession from Session::AbstractStore and add indifferent access to Session::AbstractStore. 2009-04-26 14:33:57 -05:00
Joshua Peek
c8919f4c7c Require an ActionDispatch::Request to use response assertions 2009-04-26 11:52:45 -05:00
Joshua Peek
6940c0de12 Unify functional and integration tests cookie helpers 2009-04-26 11:37:11 -05:00
Hongli Lai (Phusion)
3cb97aeea8 Fix environment variable testing code in failsafe.rb.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-04-26 11:23:10 -05:00
Joshua Peek
82bc768dad Fix typo in stale session check [#2404 state:resolved] 2009-04-26 11:19:42 -05:00
Joshua Peek
5ea8d40156 Deprecate response.redirect_url_match?, use assert_match instead. 2009-04-26 11:16:14 -05:00
Joshua Peek
5352a2417b Move useful response test helpers into request 2009-04-26 11:12:33 -05:00
Joshua Peek
4f412a10b6 Remove RewindableInput middleware since all input MUST be rewindable according to a recent change in the Rack 1.0 SPEC 2009-04-25 14:04:03 -05:00
Joshua Peek
b69da86ea5 Remove vendored version of Rack 2009-04-25 13:56:37 -05:00
Joshua Peek
044794fc9e Remove pending rack specifications until they are official 2009-04-25 13:41:30 -05:00
Joshua Peek
dd2ed32418 Start to integrate some of the features in Rack::Test.
Eventually commit ActionDispatch::Test::MockRequest and ActionDispatch::Test:: UploadedFile upstream.
2009-04-24 20:24:54 -05:00
rick
3c4c6bd0df * Add pluggable JSON backends with support for the JSON gem. [rick]
Example: ActiveSupport::JSON.backend = "JSONGem"

  All internal Rails JSON encoding is now handled by ActiveSupport::JSON.encode().  Use of #to_json is not recommended, as it may clash with other libraries that overwrite it.  However, you can recover Rails specific functionality
  if you really want to use #to_json.

    gem 'json'
    ActiveSupport::JSON.backend = "JSONGem"

    class ActiveRecord::Base
      alias to_json rails_to_json
    end
2009-04-23 00:08:40 -07:00
Yehuda Katz + Carl Lerche
0a132c2fe1 Refactor ActionView::Path
* Decouple from ActionController and ActionMailer
  * Bring back localization support.
  * Prepare to decouple templates from the filesystem.
  * Prepare to decouple localization from ActionView
  * Fix ActionMailer to take advantage of ActionView::Path
2009-04-22 17:24:41 -07:00
Jeremy Kemper
b2d6fdae35 Fix tests on 1.9 2009-04-22 17:07:04 -07:00
Jeremy Kemper
7f6779c1d5 Merge branch 'master' into cherry
Conflicts:
	activesupport/lib/active_support.rb
2009-04-22 16:53:58 -07:00
Jeremy Kemper
6fee981fa4 Opt in to JSON 2009-04-22 16:48:58 -07:00
Jeremy Kemper
f5d720fb96 Opt in to Dependencies 2009-04-22 16:42:14 -07:00
Jeremy Kemper
ab321268f8 No more free lunch 2009-04-22 16:10:49 -07:00
Jeremy Kemper
70c544df71 Rack::Utils.body_to_s doesn't exist in 1.0 2009-04-22 00:22:07 -07:00
Jeremy Kemper
f49e344128 Reinstate Base#render_to_string. Introduce AbstractController#render_to_string which stringifies render_to_body. 2009-04-21 16:02:30 -07:00
Jeremy Kemper
b10fb7e7bc Merge branch 'master' of git@github.com:rails/rails 2009-04-20 18:34:43 -07:00
Mislav Marohnić
7ce0778a15 Always buffer rack.input if it is not rewindable
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-04-17 21:53:44 -05:00
Jeremy Kemper
a22a778f86 render_for_text pushes a body part instead of replacing the whole body 2009-04-17 21:33:09 -05:00
Jeremy Kemper
1414e2afbb Don't set Content-Length in Base#response_body= since body may be any Rack-compatible body. Leave it up to the content length middleware. 2009-04-17 18:36:28 -05:00
Jeremy Kemper
df42d26f99 Rename render_to_string to render_to_body since it may return any Rack-compatible body, not just strings 2009-04-17 18:34:49 -05:00
lifo
5b92dcb675 Merge docrails 2009-04-17 14:28:46 +01:00
Carl Lerche & Yehuda Katz
b49027e188 Make more Template methods public to make ActionMailer tests pass 2009-04-16 11:57:27 -07:00
Ross Kaffenburger and Bryan Helmkamp
256b0ee8e3 Don't check authenticity tokens for any AJAX requests 2009-04-15 16:04:21 -07:00
Carl Lerche & Yehuda Katz
3c1187699a Makes rails-dev-boost work again 2009-04-14 18:32:31 -07:00
Joshua Peek
109a3876f0 Move middleware stack out of utils folder 2009-04-14 18:32:31 -07:00
Joshua Peek
c2511f936e Make dispatcher instances immutable 2009-04-14 18:32:31 -07:00
Joshua Peek
d7751036fa Final blow to CGI 2009-04-14 18:32:31 -07:00
Joshua Peek
cf44788b06 We aren't using UploadedStringIO and UploadedTempfile anymore 2009-04-14 18:32:31 -07:00
Carl Lerche & Yehuda Katz
d39f5f18bb Move all Templates methods not used by other class into private to
define surface area of the class.
2009-04-14 18:32:31 -07:00
Joshua Peek
9954494397 Move MimeResponds into base folder 2009-04-14 17:08:38 -05:00
Joshua Peek
d7396b5ca9 Move reloader middleware in ActionDispatch 2009-04-14 17:06:32 -05:00
Joshua Peek
1d2686517c Session management belongs in base folder 2009-04-14 17:02:38 -05:00
Joshua Peek
97a88a91cb Move middleware stack out of utils folder 2009-04-14 16:56:45 -05:00
Joshua Peek
13bb6a9a99 Backwords compat alias for ActionController::Request and ActionController::Response 2009-04-14 16:55:10 -05:00
Joshua Peek
ef08aa45b1 Use rack's status code list as a base 2009-04-14 16:47:03 -05:00
Joshua Peek
c1b4a5eb56 Make dispatcher instances immutable 2009-04-14 16:21:06 -05:00
Joshua Peek
4a3afe0b4f Final blow to CGI 2009-04-14 16:18:24 -05:00
Joshua Peek
11d4bfb18c We aren't using UploadedStringIO and UploadedTempfile anymore 2009-04-14 15:56:13 -05:00
Joshua Peek
4839fe2e82 Move bundled rack into ActionDispatch 2009-04-14 15:52:23 -05:00
Carl Lerche & Yehuda Katz
647b83d50c Resurrecting 1.9 compatibility. 2009-04-13 16:56:04 -07:00
Carl Lerche & Yehuda Katz
906aebceed Bring abstract_controller up to date with rails/master
Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list
of commits that could not be applied cleanly or are obviated with the
abstract_controller refactor. They all need to be revisited to ensure
that fixes made in 2.3 do not reappear in 3.0:

2259ecf368e6a6715966f69216e3ee86bf1a82a7
AR not available
  * This will be reimplemented with ActionORM or equivalent

06182ea02e92afad579998aa80144588e8865ac3
implicitly rendering a js response should not use the default layout
[#1844 state:resolved]
  * This will be handled generically

893e9eb99504705419ad6edac14d00e71cef5f12
Improve view rendering performance in development mode and reinstate
template recompiling in production [#1909 state:resolved]
  * We will need to reimplement rails-dev-boost on top of the refactor;
    the changes here are very implementation specific and cannot be
    cleanly applied. The following commits are implicated:

      199e750d46c04970b5e7684998d09405648ecbd4
      3942cb406e1d5db0ac00e03153809cc8dc4cc4db
      f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690
      e3b166aab37ddc2fbab030b146eb61713b91bf55
      ae9f258e03c9fd5088da12c1c6cd216cc89a01f7
      44423126c6f6133a1d9cf1d0832b527e8711d40f

0cb020b4d6d838025859bd60fb8151c8e21b8e84
workaround for picking layouts based on wrong view_paths
[#1974 state:resolved]
  * The specifics of this commit no longer apply. Since it is a two-line
    commit, we will reimplement this change.

8c5cc66a831aadb159f3daaffa4208064c30af0e
make action_controller/layouts pick templates from the current instance's
view_paths instead of the class view_paths [#1974 state:resolved]
  * This does not apply at all. It should be trivial to apply the feature
    to the reimplemented ActionController::Base.

87e8b162463f13bd50d27398f020769460a770e3
fix HTML fallback for explicit templates [#2052 state:resolved]
  * There were a number of patches related to this that simply compounded
    each other. Basically none of them apply cleanly, and the underlying
    issue needs to be revisited. After discussing the underlying problem
    with Koz, we will defer these fixes for further discussion.
2009-04-13 15:18:45 -07:00
Yehuda Katz and Carl Lerche
1aadafda8d Updated old AC::Base for small changes to AV 2009-04-08 17:33:41 -07:00
Yehuda Katz and Carl Lerche
6c05b5e938 Temporarily modifies setup to call super directly. This can support more T::U runners. 2009-04-08 17:33:41 -07:00
Yehuda Katz and Carl Lerche
3cecbc21e3 Get Base2 layouts to work :) 2009-04-07 17:57:20 -07:00
Yehuda Katz and Carl Lerche
95c9718118 Layouts work in AbstractController. Add support for the rspec runner for T::U 2009-04-07 15:54:02 -07:00
Yehuda Katz and Carl Lerche
c1aa5b0e14 Add depends_on, use, and setup to abstract up ideas about module inheritance. 2009-04-07 14:57:18 -07:00
Doug McInnes
c877857d59 Fix for TestResponse.cookies returning cookies unescaped [#1867 state:resolved]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-04-07 13:21:41 -05:00
Kenny Ortmann
f448c70b3f added tests for session options being defaulted correctly to rack defaults [#2403 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-04-07 09:18:42 -05:00
Pratik Naik
632bbbfe1c Merge docrails 2009-04-05 12:36:36 +01:00
José Valim
1ab7c37671 Object names with underscore do the wrong lookup in I18n on error_messages_for.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2390 state:committed]
2009-04-05 21:08:14 +12:00
Ryan Angilly
dd2eb1ea7c adding session_options initialization and test [#2303 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-24 10:54:19 -05:00
thedarkone
ae9f258e03 Fix template extension parsing. [#2315 state:resolved] [#2284 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-24 10:54:18 -05:00
thedarkone
e3b166aab3 Simplify handling of absolute path templates. [#2276 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-24 10:54:17 -05:00
Peter Marklund
8fa4275a72 Reset request_parameters in TestRequest#recycle! to avoid multiple posts clobbering each other [#2271 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-24 10:54:15 -05:00
Pratik Naik
f97832b1e4 Merge docrails 2009-03-24 12:15:43 +00:00
Yehuda Katz and Carl Lerche
1d3e2c2b73 In the middle of some refactoring... some fails due to changes in AbstractController not yet reflected in ActionController tests 2009-03-23 18:06:47 -07:00
Yehuda Katz and Carl Lerche
a501638e9d Checkpoint 2009-03-23 15:45:01 -07:00
Yehuda Katz
34f058e082 Add a bunch of tests for various render :action, layout combinations 2009-03-23 12:07:34 -07:00
Carl Lerche
c6123c3703 Finished implementing layout for render :text 2009-03-23 10:23:14 -07:00
Carl Lerche
81e814adfa Working on being able to render :text with layouts 2009-03-23 10:23:14 -07:00
Yehuda Katz
890321e51e Get very basic layouts working.
* Required small architecture change
2009-03-19 15:45:48 -07:00
Yehuda Katz
8ab37c7660 Started implementing render :action 2009-03-19 13:35:39 -07:00
Jeremy Kemper
0d5b50ee3a pluginize concurrent block body part 2009-03-19 03:31:55 -07:00
Yehuda Katz
e0447023db Implemented basic template rendering in AC::Base2:
* Created several macros for writing simpler specs
* Finished making Rack::Test work right
* Implemented render_to_string
* Status Codes
* render :text => nil
2009-03-18 15:58:47 -07:00
Jeremy Kemper
6335f5d518 Merge branch 'master' into bodyparts 2009-03-18 11:18:48 -07:00
Yehuda Katz
e6e3e3dfbc Temporarily reraise to simplify debugging 2009-03-17 18:04:41 -07:00
Yehuda Katz
f55514125c Working toward getting a basic AbstractController framework 2009-03-17 18:04:22 -07:00
Pratik Naik
18eb80ccc7 Merge docrails 2009-03-16 11:28:36 +00:00
Joshua Peek
46c12fdcb6 ruby 1.9 compat: Pathname doesn't support =~ 2009-03-15 23:29:00 -05:00
Joshua Peek
39ff550fa8 Ensure our bundled version of rack is at the front of the load path 2009-03-15 22:54:26 -05:00
David Heinemeier Hansson
73fc42cc0b Prepare for final 2.3 release 2009-03-15 22:06:50 -05:00
misfo
7706b57034 allowed render :file to take Pathnames [#2220 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-14 10:42:02 -05:00
Joshua Peek
112056333f Add Rack version to Rails info 2009-03-14 10:37:20 -05:00
Mike Gunderloy
07710fd3e0 Fix requirements for additional member/collection routes [#2054 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-14 10:06:00 -05:00
Jeremy Kemper
4a7b11d5d8 Less ceremony 2009-03-13 18:49:53 -07:00
Joshua Peek
5b025a1d11 Revert 5b7527ca "Failing test for routes with member & requirement" [#2054 state:wontfix] 2009-03-13 17:13:18 -05:00
Joshua Peek
eced3d8c55 Update rack to fix multipart uploads with an empty file [#1945 state:resolved] 2009-03-13 17:13:10 -05:00
Jeremy Kemper
b2f98c13a3 Simplify parts and tests 2009-03-13 03:16:14 -07:00
Jeremy Kemper
5d76dee329 Example using an edge side include body part to fetch queued rendering results 2009-03-13 02:55:24 -07:00
Jeremy Kemper
7c1714cbd0 Body parts: future rendering, threaded future, queued future, open-uri example 2009-03-13 02:36:15 -07:00
Jeremy Kemper
79b0b1a0ef Extract Response#string_body? 2009-03-13 02:15:51 -07:00
Jeremy Kemper
7e6c310b05 Merge branch 'master' into bodyparts
Conflicts:
	actionpack/lib/action_view/base.rb
2009-03-13 01:10:39 -07:00
Jeremy Kemper
3d260760f0 Introduce flush_output_buffer to append the buffer to the response body then start a new buffer. Useful for pushing custom parts to the response body without disrupting template rendering. 2009-03-13 00:25:05 -07:00
Jeremy Kemper
91d2740595 Return body parts directly to Rack rather than building a response string ourselves. Allows Rack middleware to orchestrate response building. 2009-03-12 21:47:34 -07:00
Jeremy Kemper
5f1d6465b4 Change naming to match 2.2 so life is easier on plugin developers 2009-03-12 13:32:52 -07:00
Jeremy Kemper
82c6597dc2 Eliminate internal render stack since we only need its head and tail 2009-03-12 12:34:47 -07:00
Jeremy Kemper
c8c2b3820e Eliminate internal render stack since we only need its head and tail 2009-03-12 12:34:22 -07:00
Yehuda Katz
a2637e9f1f Try to build a new AC::Base on top of AbstractController 2009-03-12 13:19:13 -06:00
Yehuda Katz
72b365ece9 Move Abstract stuff to autoload 2009-03-12 13:18:15 -06:00
Yehuda Katz
0c92a51dad Handle nil QS 2009-03-12 13:17:57 -06:00
Mike Gunderloy
d771e7d17f Handle irregular plurals in polymorphic_urls [#2212 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-12 17:02:07 +00:00
Donald Parish
be7b64b35a Support MD5 passwords for Digest auth and use session_options[:secret] in nonce [#2209 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-12 13:24:54 +00:00
Russ Smith
f2c7508bef Update bundled Rack to fix Litespeed compatibility [#2198 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-11 12:50:24 -05:00
Mislav Marohnić
fa45540cdb Ensure correct content type is declared after cache hits on actions with string cache keys [#1585 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-10 23:31:19 +00:00
Joshua Peek
0a887e2386 check for rack 1.0 gem before falling back to bundled version 2009-03-10 15:09:44 -05:00
Joshua Peek
572e0aac80 update bundled version of rack before 2.3 final 2009-03-10 15:05:38 -05:00
Eugene Pimenov
bdfa733d04 Ensure auto_link doesnt linkify URLs in the middle of a tag [#1523 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-10 16:52:21 +00:00
Joshua Peek
224a534400 reset_session should force a new session id to be generated [#2173] 2009-03-09 22:46:03 -05:00
Andrew Bloom
90dba00822 Ensure blank path_prefix works as expected [#2122 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-09 15:27:13 +00:00
rpheath
1ab2ff58ed Fixed number_to_phone to work with 7 digit numbers [#2176 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-09 12:53:44 +00:00
Jeremy Kemper
a3e67a15ed Prototype helpers support the onCreate callback.
[#1074 state:committed]
2009-03-08 13:41:51 -07:00
Mike Gunderloy
5e0f6214d2 Support OPTIONS verb in route conditions [#1727 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-08 12:37:17 +00:00
Tom Stuart
5c87e9addd Ensure shallow routes respects namespace [#1356 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-07 22:50:58 +00:00
Joshua Peek
ea8488caef Fixed simplified render with nested models [#2042 state:resolved] 2009-03-07 14:05:18 -06:00
Matt Jones
87e8b16246 fix HTML fallback for explicit templates [#2052 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-07 13:32:46 -06:00
Lawrence Pit
77f7d98e38 submit_tag with confirmation and disable_with [#660 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-07 13:29:35 -06:00
Dan Barry
45494580d9 Ensure Active Record error related view helpers escape the message [#1280 state:resolved] [Inge Jørgensen, Dan Barry]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-07 18:55:19 +00:00
Pratik Naik
272c2d2e9c Ensure assert_select works with XML namespaced attributes [#1547 state:resolved] [Jon Yurek] 2009-03-07 16:13:34 +00:00
Pratik Naik
a0bb8bcb16 Remove unused variable [#1451 state:resolved] [Raphaël Valyi] 2009-03-07 15:53:40 +00:00
Johan Sørensen
c071123b3e Ensure expires_in without a :public key sets the Cache-Control header to private. [#2095 state:resolved]
This fixes a regression introduced in f2a32bd0, which wasn't exposed due to two
test methods having the same name.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-07 12:18:10 +00:00
thedarkone
3191535ff0 Fix layouts with absolute paths [#2134 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-05 18:49:22 -06:00
Mike Gunderloy
5b7527ca44 Failing test for routes with member & requirement [#2054 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-05 18:46:59 -06:00
David Heinemeier Hansson
b1c989f28d Fixed that redirection would just log the options, not the final url (which lead to "Redirected to #<Post:0x23150b8>") [DHH] 2009-03-05 12:22:49 +01:00
Joshua Peek
638b3b15a1 Generating routes with optional format segment does not inherit params format [#2043 state:resolved] 2009-03-04 14:37:59 -06:00
Mike Gunderloy
ce56c5daa8 Allow routes with a trailing slash to be recognized
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2039 state:committed]
2009-03-04 14:27:39 +13:00
Yehuda Katz
f8088d7def memoize correctly ;) 2009-03-03 17:20:57 -08:00
Yehuda Katz
6001cea5d7 Helpers with an initial test 2009-03-03 16:42:20 -08:00
Pratik Naik
5029210914 Use Array.wrap() instead of Array() and handle action_view.cache_template_loading being false 2009-02-28 19:03:41 +00:00
Pratik Naik
8607740a29 Ensure the old behaviour is retained when action_view.cache_template_loading is not set explicitly 2009-02-28 17:42:15 +00:00
Gregg Pollack
f2a32bd0de Added ability to pass in :public => true to fresh_when, stale?, and expires_in to make the request proxy cachable [#2095 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-28 10:33:42 +01:00
Yehuda Katz
9510070f78 Fixes multiple conditions 2009-02-27 19:37:09 -08:00
Yehuda Katz
c16c7a8de4 Add support for callbacks 2009-02-27 19:25:45 -08:00
Yehuda Katz
ee80dad680 Initial hooks 2009-02-27 15:11:02 -08:00
Yehuda Katz
d1157e7242 AbstractController now supports layouts and rendering 2009-02-27 11:42:13 -08:00
David Heinemeier Hansson
77b0994c78 Prep for RC2 later today 2009-02-27 14:46:23 +01:00
David Heinemeier Hansson
6de83562f9 Force all internal calls to Array#to_sentence to use English [#2010 state:resolved] 2009-02-27 14:22:39 +01:00
Eloy Duran
3d1d422b8b Pass a custom form builder on to nested fields_for calls. [#2023 status:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-27 13:56:27 +01:00
Sam Granieri
0a8c003b1e Ruby 1.9 compat: silence a warning about regexp languages
[#2050 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-02-25 09:38:26 -08:00
Yehuda Katz
b1f078bddf First, very early, AbstractController code. More to come 2009-02-24 17:25:21 -08:00
Joshua Peek
1b22071b27 Ensure ActiveRecord session store's connections are checked in after each request [#1927 state:resolved] 2009-02-24 11:34:32 -06:00
thedarkone
85df4841dd Template without a known template handler should only be reachable through its exact path. [#2027 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-24 10:41:45 -06:00
Matt Jones
b35562f432 correctly handle layouts for AJAX requests and regular js files [#2052 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-24 10:38:07 -06:00
Pratik Naik
53cd102b39 Merge with docrails 2009-02-24 12:29:25 +00:00
Andrew White
3248553d32 Fix requirements regexp for path segments
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1772 state:committed]
2009-02-22 15:35:22 +13:00
Andrew White
f7a0a394f4 Remove hardcoded number_of_capturesin ControllerSegment to allow regexp requirements with capturing parentheses
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1887 state:committed]
2009-02-22 15:34:01 +13:00
Sven Fuchs
8c5cc66a83 make action_controller/layouts pick templates from the current instance's view_paths instead of the class view_paths [#1974 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-20 14:19:45 -06:00
Joshua Peek
69c049f5ab Move development mode reloading up the stack to avoid issues with class reloading in middleware 2009-02-20 12:04:57 -06:00
Sven Fuchs
53fe301a42 Lazy evaluate middleware arguments [#2028 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-20 10:50:21 -06:00
Joshua Peek
9702636a08 Lazy evaluate ActionController session store middleware class to pickup custom plugin session stores [#2001 state:resolved] 2009-02-19 21:21:34 -06:00
Joshua Peek
f8ea9f85d4 Fix templates reloading in development when using custom view path [#2012 state:resolved] 2009-02-19 20:55:56 -06:00
Joshua Peek
b6e56efe07 Special case in deprecated CGI proxy layer for Mongrel CGI cookies [#1957 state:resolved] 2009-02-16 22:17:54 -06:00
Joshua Peek
460269dcaf Autoload ActionController::Caching::Sweeper constant [#1977 state:resolved] 2009-02-16 14:37:42 -06:00
Joshua Peek
0096eb1555 Removed dead convert_expires! in Response [#1952 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-16 14:18:06 -06:00
Donald Parish
86d8f92282 Fixed http digest authentication to use credentials URI passed from client. [#1848 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-02-16 20:20:23 +01:00
Joshua Peek
238a6bb62d Update bundled rack to fix more parameter parsing issues 2009-02-14 18:23:08 -06:00
Sven Fuchs
0cb020b4d6 workaround for picking layouts based on wrong view_paths [#1974 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-14 18:22:41 -06:00
Tekin Suleyman
d676a7f18a Updated rdoc to reflect changes to form option helpers
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#837 state:committed]
2009-02-14 14:51:40 +13:00
Tekin Suleyman
1525f3816e Enhanced form option helpers to add support for disabled option tags and use of anonymous functions for specifying selected and disabled values from collections.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-02-14 14:51:35 +13:00
Sam Oliver
f04346d8b9 Stops date select helpers from defaulting the selected date to today if :prompt option has been used
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#561 state:resolved]
2009-02-13 22:04:27 +13:00
Lance Ivy
5dbc9d40a4 Changed API of NestedAttributes to take an array, or hash with index keys, of hashes that have the id on the inside of the attributes hash and updated the FormBuilder to produce such hashes. Also fixed NestedAttributes with composite ids.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
[#1892 state:committed]
2009-02-13 21:47:56 +13:00
thedarkone
3942cb406e Port fast reloadable templates from rails-dev-boost. 2009-02-12 13:04:12 -06:00
Joshua Peek
ff3fb6c5f3 Reapply 0d5b3e6 2009-02-10 13:36:50 -06:00
Joshua Peek
5689e681e9 Update vendored rack 2009-02-10 13:18:13 -06:00
Joshua Peek
f400209084 Move checkbox hidden field before the actual checkbox so the actual value doesn't get clobbered [#1863 state:resolved] 2009-02-10 13:10:46 -06:00
Andrew White
199e750d46 Fix some edge cases when the same template is called with different local assigns
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-10 12:09:49 -06:00
Joshua Peek
0d5b3e6b41 Make sure vendored rack is at the front of the load path 2009-02-10 10:48:54 -06:00
David Heinemeier Hansson
7527cdf79c Added partial scoping to TranslationHelper#translate, so if you call translate('.foo') from the people/index.html.erb template, you'll actually be calling I18n.translate(people.index.foo) [DHH] 2009-02-10 12:57:12 +01:00
Andrew White
893e9eb995 Improve view rendering performance in development mode and reinstate template recompiling in production [#1909 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-09 14:20:30 -06:00
Joshua Peek
5fbacde2af Session LazyHash#inspect triggers the hash to load 2009-02-07 16:47:44 -06:00
Joshua Peek
acd0612cde Don't add vendored rack to load path 2009-02-07 16:22:33 -06:00
Joshua Peek
524d8edf68 Update bundled Rack for Ruby 1.9 spec changes 2009-02-07 16:18:09 -06:00
Joshua Peek
0edb0a4fac Deprecate ActionController::Response#set_cookie :http_only option infavor of :httponly 2009-02-07 15:37:54 -06:00
Joshua Peek
3c625d65e8 Ruby 1.9 compat: removed redundant nested repeat operator 2009-02-07 15:33:11 -06:00
Joshua Peek
e4a7c0bb5b ~ backup files don't clobber original templates [#1818 state:resolved] 2009-02-07 12:06:35 -06:00
Andrew White
5f5d2d30a0 Move cleanup before prepare_dispatch so that constants are not loaded twice [#1898 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-07 11:41:00 -06:00
José Valim
50f51ff950 Render implicit html template when xhr request now supports localization [#1886 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-07 11:37:02 -06:00
Joshua Peek
2277fbedbe Temporarily bundle Rack 1.0 prerelease for testing 2009-02-07 00:08:28 -06:00
José Valim
24f2e676f7 Added support to dashed locales in templates localization [#1888 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-06 23:23:50 -06:00
Joshua Peek
43c09383ce Ensure session id is set in session options hash [#1880 state:resolved] 2009-02-06 23:16:58 -06:00
Eugene Pimenov
b1c1e3deb7 Ruby 1.9 compat: change encoding of action_view/renderable to utf-8, so erb templates can use utf-8 properly
[#1881 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-02-06 11:03:41 -08:00
Eugene Pimenov
ae36fcedce Ruby 1.9 compat: call bytesize for content_length
[#1881 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-02-06 10:28:09 -08:00
Joshua Peek
7259baab47 Restore stale session check and move after dispatch development cleanups before the request 2009-02-05 20:22:43 -06:00
Andrew White
bccd2c54b2 Use Path rather than EagerPath when cache_classes == false so other view paths are properly recompiled in development mode [#1764 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-05 19:56:22 -06:00
Pascal Ehlert
d15d53cf81 Allowing an object to be passed explicitly to a fields_for with nested_attributes on one-to-one associations
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1849 state:committed]
2009-02-06 13:26:58 +13:00
Andrew White
7aa847fab4 Eliminate unnecessary File.exist? when correct file extension given [#1879 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-05 15:38:29 -06:00
Adam McCrea
06182ea02e implicitly rendering a js response should not use the default layout [#1844 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-05 15:23:05 -06:00
chris finne
b80fa817d4 Fix a syntax error in current_page?() that was prevent matches against URL's with multiple query parameters [#1868 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-05 20:31:04 +01:00
David Heinemeier Hansson
46288f5935 Remove double parenthesis in docs 2009-02-05 20:27:34 +01:00
Yehuda Katz
d6b9f8410c Remove errant debug code 2009-02-03 08:04:14 -08:00
Jeremy Kemper
34a37ea9e8 Workaround jruby issue with protected module attr_accessor showing up as public in included class 2009-02-02 22:39:02 -08:00
Jeremy Kemper
2259ecf368 Don't assume ActiveRecord is available 2009-02-02 22:26:57 -08:00
Yehuda Katz
6faff0223b Merge commit 'rails/3-0-unstable' 2009-02-02 09:54:27 -08:00
Yehuda Katz
44cdf0c5fe Some merge cleanup 2009-02-02 09:54:23 -08:00
José Valim
2ecc678ed6 Added localized rescue (404.da.html) [#1835 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-02 17:56:22 +01:00
Pratik Naik
beca1f2e15 Template#mime_type should not use Mime::Type when Action Controller is not included 2009-02-02 00:21:03 +00:00
Joshua Peek
5b5d0e325d Use Rack::Head middleware to ensure the body is discarded for HEAD requests 2009-02-01 01:01:49 -06:00
Joshua Peek
28b65c9120 Removed Prototype specific Safari 2 AJAX hack.
The normal null character stripper is still there.
2009-01-31 23:51:41 -06:00
Tarmo Tänav
80747e9db1 Removed map.resources :only/:except inheritance
It's very rare for these options to apply identically to nested child resources, and with this inheritance on it's very difficult to have a child resource with more actions than the parent.

This reverts commit 2ecec6052f7f290252a9fd9cc27ec804c7aad36c.

Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1826 state:committed]
2009-02-01 14:47:56 +13:00
Eloy Duran
ec8f045844 Add support for nested object forms to ActiveRecord and the helpers in ActionPack
Signed-Off-By: Michael Koziarski <michael@koziarski.com>

[#1202 state:committed]
2009-02-01 14:44:30 +13:00
Jeremy Kemper
4945d92b03 Remove dead cgi_ext require 2009-01-31 14:46:02 -08:00
Jeremy Kemper
a02d752ae4 Ruby 1.9 compat: omit Rack::Lint from integration tests until it accepts String headers and bodies 2009-01-31 11:03:00 -08:00
Jeremy Kemper
4790e02e74 Ruby 1.9 compat: work around that String is not Enumerable 2009-01-31 10:55:47 -08:00
Yehuda Katz
3030bc90c9 Merge commit 'rails/3-0-unstable'
Conflicts:

	actionpack/lib/action_controller/base.rb
	actionpack/lib/action_dispatch/http/mime_type.rb
	actionpack/lib/action_dispatch/http/request.rb
	actionpack/lib/action_view/base.rb
	actionpack/lib/action_view/paths.rb
	actionpack/test/controller/session/cookie_store_test.rb
	actionpack/test/dispatch/rack_test.rb
	actionpack/test/dispatch/request_test.rb
2009-01-30 11:30:27 -08:00
Yehuda Katz
da10673e32 Sync 'rails/rails/master' 2009-01-30 10:53:19 -08:00
Scott Taylor
2dedb5b03a Controller, response, and request should all refer to same session, even after a call to session_reset [#1823 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-29 19:39:48 -06:00
Pratik Naik
b3bc4fa5e0 Digest#validate_digest_response should accept request instead of controller 2009-01-29 22:06:03 +00:00
Jon Crawford
8761663a68 Added grouped_options_for_select helper method for wrapping option tags in optgroups. [#977 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-01-29 18:00:18 +00:00
Gregg Kellogg
306cc2b920 Implement HTTP Digest authentication. [#1230 state:resolved] [Gregg Kellogg, Pratik Naik]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-01-29 16:01:59 +00:00
Dan Weinand
91eeb0ff11 Using the highlight helper on text with html shouldn't highlight text inside html attributes. [#1302 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-01-28 19:53:59 +00:00
Daniel Rodríguez Troitiño
9a8e2a059c Ensure selected option is not ignored for collection_select. [#1037 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-01-28 19:35:18 +00:00
Nathan de Vries
32eeb3e521 Ensure that when UrlWriter is included in multiple classes, the default_url_options of one don't affect the other. [#1277 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-01-28 19:31:48 +00:00
Pratik Naik
2ae8d3079b Session cookie header should always be set if :expire_after option is specified 2009-01-28 05:05:48 +00:00
Joshua Peek
319ae4628f Move HTTP libs and middleware into ActionDispatch component 2009-01-27 18:54:01 -06:00
Joshua Peek
a0f2b1d95d Reorganize ActionController folder structure 2009-01-27 18:17:39 -06:00
Jeremy Kemper
9714a9b001 Use toplevel reference to ::StringIO since we're in a BasicObject. 2009-01-27 15:25:05 -08:00
Tys von Gaza
dd02af5c7e Fix for sweepers method_missing missing &block argument [#1581 status:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-01-27 16:11:45 -06:00
Joshua Peek
093f758bd0 Restore implicit rendering for XHR requests that want a HTML template [#1590 state:resolved] 2009-01-27 14:09:11 -06:00
Joshua Peek
f17c87665e Fixed deprecated methods on TestSession [#1801 state:resolved] 2009-01-27 12:28:05 -06:00
Pratik Naik
57b156b338 Dont use Memoizable for ActionController::Request 2009-01-27 17:26:37 +00:00
Yaroslav Markin
17db28f1ca Improve i18n support for number_to_human_size helper:
* now using pluralization properly
* storage unit translations moved to number.human.storage_units.units
* introduced number.human.storage_units.format for languages that do not follow "{{number}} {{unit}}" format (Japanese)

NOTE: I18n table changed, you will need to update your translations.

[#1634 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-01-27 09:22:00 -08:00
Joshua Peek
a1ac635d96 Ensure the full path is used when searching for layouts [#1803 state:resolved] 2009-01-27 11:08:29 -06:00
Joshua Peek
57f0b85900 Fix for failing ActionMailer multipart tests 2009-01-26 13:15:29 -06:00
Joshua Peek
a98cd7ca9b Add localized templates
# Default locale
  app/views/messages/index.html.erb

  # I18n.locale is set to :da (Danish)
  app/views/messages/index.da.html.erb
2009-01-25 22:51:21 -06:00
Yehuda Katz
eb9af20b7c Begin unifying the interface between ActionController and ActionView 2009-01-22 16:18:10 -06:00
Joshua Peek
73cc5f270a Setup ActiveRecord QueryCache middleware in the initializer 2009-01-21 12:44:07 -06:00
Joshua Peek
ae3a93ad89 Missed RequestParser in ff0a267 2009-01-21 12:29:41 -06:00
Joshua Peek
a8ad6568f9 Allow empty files to be uploaded 2009-01-20 20:34:35 -06:00
Joshua Peek
7e4d13d357 Add MiddlewareStack#swap
config.middleware.swap ActionController::Session::CookieStore, MySessionStore
2009-01-20 20:19:52 -06:00
Mislav Marohnić
01f06fc7f4 Don't let empty Tempfiles come through as uploaded files [#1785 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-20 12:38:25 -06:00
Cody Fauser
c090e5e075 Restore cookie store httponly default to true. Remove extraneous dup of options on initialization [#1784 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-20 11:50:43 -06:00
Pratik Naik
9cefd5ea0c Deprecate ActionController::Base#session_enabled? 2009-01-19 18:53:14 +00:00
Pratik Naik
39e1ac658e Merge docrails 2009-01-18 18:10:58 +00:00
Pratik Naik
085991891e Bump up the year in MIT license files 2009-01-18 05:28:21 +00:00
Pratik Naik
41af606db3 Remove script/performance/profiler in favour of performance integration tests.
To continue using script/performance/profiler, install the request_profiler plugin :

  script/plugin install git://github.com/rails/request_profiler.git
2009-01-18 05:20:39 +00:00
Joshua Peek
ff0a2678c4 Build query string and POST params parser on top of Rack::Request. Also switch our multipart parser to use Racks. Moved XML, JSON, and YAML parsers into ActionController::ParamsParser middleware [#1661 state:resolved] 2009-01-17 20:29:50 -06:00
Joshua Peek
29e7a02428 Ensure any method sent to RewindableIO reads the original IO object [#1767 state:resolved] 2009-01-17 11:12:18 -06:00
Joshua Peek
515a1a3328 Lock middleware has been committed upstream 2009-01-17 10:16:31 -06:00
Jeremy Kemper
fe013ce934 Fix performance regression 2009-01-16 20:36:59 -08:00
Jeremy Kemper
78af271069 Skip respond_to check so rack.input doesn't have to implement it 2009-01-16 20:36:59 -08:00
Josh
7260852187 Fix date_select within fields_for with an index [#1666 state:resolved] [Josh, Frederick Cheung]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
2009-01-16 17:23:43 +00:00
Yehuda Katz
b8fadd708b Sync 'rails/rails/master' 2009-01-14 16:48:57 -08:00
Joshua Peek
b281a6a5b2 Use Rack's MethodOverride lib [#1699 state:resolved] 2009-01-13 17:26:29 -06:00
Joshua Peek
9775c25824 Update multipart tests to expose (another) bug in Rack's multipart parser 2009-01-13 17:21:45 -06:00
Yehuda Katz
f65333a4cf Sync 'rails/rails/master' 2009-01-13 14:24:14 -08:00
Joshua Peek
1adc1496f9 Add RewindableInput wrapper to fix issues with middleware that impolitely eat up non-rewindable input 2009-01-13 16:09:51 -06:00
Yehuda Katz
0932b012fa Sync 'rails/rails/master' 2009-01-13 13:28:28 -08:00
Bryan Ash
5a43908c74 Explicitly read as binary in multipart_body for Windows [#1065 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-13 14:42:43 -06:00
Cody Fauser
d3107ce3b0 Use :key instead of old :session_key in session_store.rb generator and docs [#1746 state:resovled]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-13 14:27:23 -06:00
Pratik Naik
c99ef814b0 Revert "HTTP Digest authentication [#1230 state:resolved]"
This reverts commit 45dee3842d68359a189fe7c0729359bd5a905ea4.

Reasons :

1. The code is not working in it's current state
2. Should not be using exceptions for flow control
2009-01-13 16:13:42 +00:00
Pratik Naik
5339f813be Change Object#try to raise NoMethodError on private methods and always return nil when Object is nil [Pratik Naik, Lawrence Pit] 2009-01-13 03:28:32 +00:00
Yehuda Katz
e8980ad278 Sync 'rails/rails/master' 2009-01-09 18:58:47 -08:00
Joshua Peek
ac4bf1180a Ensure we override Rack::Request's POST method too 2009-01-09 13:12:39 -06:00