Commit Graph

4158 Commits

Author SHA1 Message Date
José Valim
e5a2a9fced Remove URI object from ActiveResource notification, send the :mailer class in AM (like in AP#process_action) and remove locale instrumentation. 2010-01-15 15:57:33 +01:00
José Valim
4598d88749 Ensure log is flushed and tailed on failures. 2010-01-15 14:16:52 +01:00
José Valim
a5a9156b4e Template rendering should include layout time. 2010-01-15 12:24:32 +01:00
José Valim
88dd60298e Do not send the whole controller in notifications, cherry pick required pieces. 2010-01-15 12:24:31 +01:00
José Valim
8b9bff9557 Small tweaks in ActionController subscriber messages format. 2010-01-15 12:24:31 +01:00
José Valim
8c8942ed4f Move Dispatcher setup to Railties and add instrumentation hook. 2010-01-15 12:24:30 +01:00
Joshua Peek
be968ecd8b Respect resources_path_names and :path_names options in new dsl 2010-01-13 20:26:01 -06:00
Joshua Peek
0f51e45307 optimise_named_routes is unnecessary 2010-01-13 20:22:53 -06:00
José Valim
9038a4af35 Add documentation to f.submit and make scaffold generators use the new shortcut. 2010-01-14 02:02:07 +01:00
José Valim
35933822de Ensure optional path scopes are properly handled. 2010-01-14 01:31:17 +01:00
Stephen Celis
2835ec6134 Custom 'type' attribute support for text_field. [#3646 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-14 01:07:04 +01:00
José Valim
214b548485 Make check boxes accept :multiple as option so they can handle collections (such as HABTM). 2010-01-14 01:07:03 +01:00
José Valim
d50bf47b00 Call :to_model before working with the object. 2010-01-14 01:07:03 +01:00
Carlos Antonio da Silva
8e0208f650 Add possibility to use i18n translatios in submit FormHelper.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-14 01:07:03 +01:00
José Valim
f921ad5c97 Tidy up ActiveRecord and Views runtime information on process action logger. 2010-01-14 01:07:03 +01:00
Joshua Peek
d01716731b Add router support for resources :only and :except actions 2010-01-13 17:23:14 -06:00
Joshua Peek
bf9b81e2cb Pass :as to resources to change the resource name 2010-01-13 12:18:06 -06:00
Joshua Peek
521ef3c40f Passing in a crud action overloads the default action instead of creating a
new member action.
2010-01-13 11:45:27 -06:00
José Valim
b0d35ad00c Test fragment/page cache and send data/file notifications. 2010-01-13 01:19:24 +01:00
José Valim
da5978c223 Add subscriber for ActionPack and move all logging inside it. 2010-01-13 01:19:23 +01:00
José Valim
d382e93d8f Improve ActionPack logger output. 2010-01-11 23:38:17 +01:00
José Valim
a9eebde856 Merge branch 'master' of git://github.com/rails/rails 2010-01-11 15:18:24 +01:00
José Valim
0a8004efd2 Provide useful information when instrumenting partials. 2010-01-11 10:21:15 +01:00
Joshua Peek
02bbde4e78 Cleanup junk metal and revise API
API Change: Returning a "X-Cascade: pass" header triggers the cascade
instead of a 404 response.
2010-01-10 23:09:10 -06:00
David Heinemeier Hansson
5ddc597066 Use safe_concat instead of trying to html_safe! what might be a frozen string 2010-01-10 18:13:43 -08:00
José Valim
d2e7c1b97d Raise an error if respond_with is invoked and no format is declared. 2010-01-10 20:21:08 +01:00
José Valim
8d72ba51ba Ensure nested namespaces work as expected. 2010-01-10 18:42:45 +01:00
Joao Carlos
36969c6ecd Fixes namespaced routes [#3673 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-10 12:49:31 +01:00
David Heinemeier Hansson
d4589e96ef Fixed that PrototypeHelper#update_page should return html_safe [DHH] 2010-01-08 13:46:30 -08:00
David Heinemeier Hansson
188d52165b Fixed that much of DateHelper wouldn't return html_safe? strings [DHH] 2010-01-08 11:49:12 -08:00
David Heinemeier Hansson
5ea130943e Fixed that fragment caching should return a cache hit as html_safe (or it would all just get escaped) [DHH] 2010-01-07 17:45:32 -08:00
José Valim
3b631df101 Ensure that segments in default_url_options also work with format specified. 2010-01-07 17:17:06 +01:00
José Valim
f149eb19d4 From now on, parameters defined in default_url_options can be absent from named routes.
This allows the following setup to work:

  # app/controllers/application_controller.rb
  class ApplicationController
    def default_url_options(options=nil)
      { :locale => I18n.locale }
    end
  end

  # From your views and controllers:
  I18n.locale                 #=> :en
  users_url                   #=> "/en/users"
  users_url(:pl)              #=> "/pl/users"
  user_url(1)                 #=> "/en/users/1"
  user_url(:pl, 1)            #=> "/pl/users/1"
  user_url(1, :locale => :pl) #=> "/pl/users/1"

If you provide all expected parameters, it still works as previously.
But if any parameter is missing, it tries to assign all possible ones
with the hash returned in default_url_options or the one passed straight
to the named route method.

Beware that default_url_options in ApplicationController is not shared
with ActionMailer, so you are required to always give the locale in your
email views.
2010-01-07 15:34:14 +01:00
José Valim
f564f947d9 Remove duplicated url_for code and move methods shared between ActionMailer and ActionController up to AbstractController. 2010-01-07 15:31:50 +01:00
José Valim
598456b68b Updated the documentation for helpers.label. 2010-01-07 15:31:50 +01:00
José Valim
c68cc49dcd Use helpers.label instead of views.labels. 2010-01-07 15:31:50 +01:00
José Valim
a091e2e4f6 errors in ActionView should not be namespaced as well. 2010-01-07 15:31:50 +01:00
José Valim
0d5ce7c525 namespace in routes changes both the path and name prefix. 2010-01-06 09:51:46 +01:00
José Valim
e4099c2ad3 Allow named routes to be debugged. 2010-01-06 09:32:29 +01:00
José Valim
10389a4c29 Ruby 1.9.1 requires hash given to foormat to contain symbols. 2010-01-06 00:42:58 +01:00
José Valim
0cf190001e Remove CGI.escape in function of Rack::Mount.escape 2010-01-06 00:33:17 +01:00
José Valim
e55d70a380 redirect in routes takes port into account [#3653 status:resolved] 2010-01-05 23:40:56 +01:00
Joshua Peek
b3900a29eb All router redirect helper to accept a full URI [#3653 state:resolved] 2010-01-05 12:00:38 -06:00
Joshua Peek
8ff4faf66a assert_template depends on AV::Template monkey patches in action_view/test_case 2010-01-05 11:48:06 -06:00
David Heinemeier Hansson
2dc5aeed6d NumberHelper#number_to_currency should output html_safe strings so the units are not escaped 2010-01-05 08:22:17 -08:00
Jeremy Kemper
5c527c2f61 Controller tests should always require view tests since they add behavior controllers expect 2010-01-04 19:44:27 -08:00
Joshua Peek
3f28e0bda6 Trash string coercion rack hacks 2010-01-04 19:46:21 -06:00
Joshua Peek
76b5f18feb Default middleware stack needs to be available at configuration time 2010-01-04 19:40:16 -06:00
Joshua Peek
2601a16ede Autoload AS test case 2010-01-04 16:22:46 -06:00
Joshua Peek
cf83a6f16b Autoload AC and AV test case classes 2010-01-04 16:22:46 -06:00
José Valim
562a00ba16 @_formats initialization should be AbstractController::Base. 2010-01-04 23:05:28 +01:00
José Valim
bd729344a7 Remove deprecated formatted named routes 2010-01-04 23:05:27 +01:00
Zach Brock
79438b4638 adding fix for auto linking to master too
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2010-01-05 10:57:20 +13:00
David Heinemeier Hansson
5e94d3e3ea Merge 2010-01-03 22:27:28 -08:00
David Heinemeier Hansson
090d12b49b Added that ActionController::Base now does helper :all instead of relying on the default ApplicationController in Rails to do it [DHH] 2010-01-03 21:32:02 -05:00
José Valim
3990310a2b Use underscore in notification namespaces. 2010-01-04 00:03:56 +01:00
José Valim
53c6984944 Add notifications to ActionDispatch::ShowExceptions, this can be used as hooks for plugins like ExceptionNotifier. 2010-01-03 23:33:34 +01:00
José Valim
6fbe9ef2ff Use namespaces in notifications. 2010-01-03 20:39:42 +01:00
Stefan Penner
d531cbc809 fixed missing or incorrect session data error message 2010-01-02 23:01:06 -08:00
Mikel Lindsaar
42aa9b87c2 Silence warnings 2010-01-02 22:39:00 -08:00
José Valim
f50bb48e04 Do not enforce human_attribute_name as required API. 2010-01-02 22:27:03 +01:00
Carsten Gehling
bef968d379 I18n label helper [#745 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-02 22:27:02 +01:00
José Valim
50aa876f32 Make rendering in ActionView happen through _render_template, as the rendering which comes from ActionController. 2009-12-31 18:40:20 -08:00
José Valim
c03c40b481 Expose a _render_partial hook as thhe _render_template one and make use of it. 2009-12-31 18:40:20 -08:00
José Valim
33c98b15bc ActionController::Logger should include AbstractController::Logger and sort autoloads for easier readability. 2009-12-31 18:40:20 -08:00
José Valim
38fa0d14a8 controller_path is required by ActionView, so move it up to AbstractController and refactor AbstractController::Layouts. 2009-12-31 18:40:20 -08:00
Carl Lerche
ae7ada1fde Some railties cleanup:
* Rename <framework>/rails.rb -> <framework>/railtie.rb
	* Rails::Plugin -> Rails::Railtie
	* Rails::Plugin::Vendored -> Rails::Plugin
2009-12-31 13:12:52 -08:00
Carl Lerche
e749424dfa Rename rails.rb -> rails/all.rb and rails/core.rb -> rails.rb 2009-12-31 13:12:52 -08:00
Carl Lerche
a23f4b6aee Add a /rails.rb for each framework for consistency 2009-12-31 11:57:59 -08:00
Jeremy Kemper
1fbd02e446 Revert "Add config.action_controller.include behavior to plugins."
This reverts commit 7e8b7f46bfc086a36db996420fbee93348c5268e.

Conflicts:

	railties/lib/rails/plugin.rb
2009-12-30 19:34:15 -08:00
Jeremy Kemper
8ad9d14494 Partially revert "ActionDispatch should require as little of ActiveSupport as possible"
Removes load path change from commit bb153f42e45160c5ef3593c393db5d3c6857fb70.
2009-12-30 17:35:17 -08:00
Carl Lerche
bb153f42e4 ActionDispatch should require as little of ActiveSupport as possible 2009-12-30 12:58:40 -08:00
Carl Lerche
2e87196d14 Use extlib_inheritable_accessor in request_forgery_protection.rb.
For some reason the current class_inheritable_accessor does not play nice with included hooks. class_inheritable_accessor will be revised shortly.
2009-12-29 13:21:36 -08:00
Yehuda Katz
cf4978313b Make sure evalled method knows where it came from 2009-12-29 01:04:32 -08:00
Jeremy Kemper
f79caa49fb Complain if there's no such middleware 2009-12-28 20:24:28 -08:00
Carl Lerche
d747b6847b Require active_support/dependencies/autoload in action_dispatch 2009-12-28 17:53:05 -08:00
Jeremy Kemper
9a650a6547 Silence some trivial warnings: shadowed local vars, indentation mismatches 2009-12-28 17:36:08 -08:00
Jeremy Kemper
7c4fb93ac3 Ruby 1.9: string is not enumerable, so #exclude? is not available 2009-12-27 15:38:00 -08:00
Jeremy Kemper
3a79117c77 Typo 2009-12-27 15:27:18 -08:00
David Heinemeier Hansson
438a8c3ec7 Require the enumberable extension from active support because we use #exclude? 2009-12-27 15:23:30 -08:00
Yehuda Katz
12e43494a7 Merge remote branch 'jose/perf' 2009-12-27 14:36:59 -08:00
David Heinemeier Hansson
95762cbbb3 Added shorthand for match 'products/overview' that expands to match 'products/overview', :to => 'products#overview', :as => 'products_overview' 2009-12-27 14:13:03 -08:00
José Valim
97db79ab3c Remove ActiveRecord runtime logging from ActionPack and place in ActiveRecord, adding it through config.action_controller.include hook. 2009-12-27 13:32:40 +01:00
José Valim
75ba102a80 Remove ActionView inline logging to ActiveSupport::Notifications and create ActionController::Base#log_event, so everything can be logged within one listener. Also expose log_process_action as a hook for different modules to include their own information during the action processing. This allow ActiveRecord to hook and any other ORM. Finally, this commit changes 'Processing' and 'Rendering' in logs to 'Processed' and 'Rendered' because at the point it's logged, everying already happened. 2009-12-26 20:28:53 +01:00
Joshua Peek
feb7382047 AD::Cascade that supports X-Cascade 2009-12-26 13:28:06 -06:00
Joshua Peek
673fa7f066 rack-mount 0.4 2009-12-26 13:25:36 -06:00
José Valim
8a36e907d2 More <%= render(@posts) %> optimization. 2009-12-26 14:11:04 +01:00
José Valim
ff1a1c0b4d Optimize <%= render(@posts) %>. 2009-12-26 14:11:04 +01:00
José Valim
c86424a72d Break instrumentation into several end-points so rendering of partials can be optimized. 2009-12-26 14:11:04 +01:00
José Valim
48273a44c6 Wrap layout rendering in one method: _render_layout (this should make partial instrumentation easier). 2009-12-26 14:11:04 +01:00
David Heinemeier Hansson
7f5d44bac5 The controller key shouldnt be part of the mapping if its not used 2009-12-25 10:14:44 -08:00
Yehuda Katz
f3b072189a Instead of marking raw text in templates as safe, and then putting them through String#<< which checks if the String is safe, use safe_concat, which uses the original (internal) String#<< and leaves the safe flag as is. Results in a significant performance improvement. 2009-12-24 21:50:18 -08:00
Yehuda Katz
baaaf2acaa Dead code 2009-12-24 21:50:17 -08:00
David Heinemeier Hansson
0a365d63f6 Translated strings in the view are assumed html_safe (Closes #3401) 2009-12-24 20:32:53 -08:00
David Heinemeier Hansson
6ce5982afa Stray carrier return 2009-12-24 16:13:50 -08:00
David Heinemeier Hansson
38af368360 Merge 2009-12-24 15:24:57 -08:00
David Heinemeier Hansson
2b7256a42e Extract Mapping class from monster match method 2009-12-24 15:23:39 -08:00
Sam Ruby
aa3565f3a6 Allow named_routes to be used with root, and with new DSL short-form.
The real use case it to make all of the following act the same:

  root 'store#index', :as => 'store'
  match '/' => 'store#index', :as => 'store'
  match '/', :to => 'store#index', :as => 'store'

The test case provided deviates from this in order to demonstrate all three
forms in a single set of test routes.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-12-23 20:55:21 -08:00
Carlhuda
84f1137ef8 Merge remote branch 'origin/master'
Conflicts:
	railties/lib/rails/application.rb
2009-12-23 19:18:11 -08:00
Carlhuda
9653599a79 Remove the ActionView::Base autoload because it creates crazy circular autoload insanity 2009-12-23 18:59:49 -08:00
Jeremy Kemper
4d3602a8c4 Routing: fix that route shorthand shouldn't ignore other options. Raise if :as option is given to root method since its name is always 'root' 2009-12-23 17:42:30 -08:00
Carlhuda
d2bd71a145 Finish moving config.frameworks-dependent code to the framework plugin 2009-12-23 17:23:29 -08:00
Jeremy Kemper
94bb331635 Shift more responsibility from application class to its singleton instance. Treat instantiation and boot as separate steps. Use app.config rather than app.configuration. 2009-12-23 17:11:17 -08:00
Carlhuda
38aeb1528c Moving out some framework specific initializers into the framework libraries. 2009-12-23 16:13:09 -08:00
David Heinemeier Hansson
e7ef57dd0d Merge 2009-12-22 17:31:29 -08:00
David Heinemeier Hansson
fe5f660413 Dont encourage __FILE__ bullshit 2009-12-22 17:25:34 -08:00
Joshua Peek
ace20bd25e Flip deferrable autoload convention 2009-12-22 17:27:37 -06:00
Joshua Peek
b1aee9f4ee All AD modules are "deferrable" 2009-12-22 17:11:21 -06:00
Joshua Peek
2d0c703c92 Use Rack::Runtime middleware so the reported time includes the entire middleware stack 2009-12-22 16:18:22 -06:00
Joshua Peek
df7faef68e Referer and user agent are in Rack::Request 2009-12-22 16:09:41 -06:00
Joshua Peek
a1bf2f96ce AD::StatusCodes support is now part of rack 2009-12-22 16:08:03 -06:00
José Valim
4964d3b02c Make ActionMailer::Base inherit from AbstractController::Base
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-22 11:29:06 -08:00
David Heinemeier Hansson
a110ff0fca Dont introspect inline templates for the logger and cleanup a few styling issues 2009-12-21 16:03:04 -08:00
David Heinemeier Hansson
fee07b9da0 Merge branch 'master' of github.com:rails/rails 2009-12-21 15:50:19 -08:00
Joshua Peek
715dd10961 Less annoying RoutingError message 2009-12-21 17:34:53 -06:00
Joshua Peek
f82e1046f8 reset_session needs to be a real method so flash can override it 2009-12-21 17:29:59 -06:00
David Heinemeier Hansson
fa8849a573 Merge branch 'master' of github.com:rails/rails 2009-12-21 11:28:16 -08:00
David Heinemeier Hansson
3ff9e9ee14 Its now possible to use match 'stuff' => 'what#stuff' instead of using the :to for simple routes 2009-12-20 20:37:36 -08:00
Joshua Peek
15f95621d5 We don't need AD parse_config 2009-12-20 21:11:42 -06:00
Yehuda Katz
17f66473bc AC::Head now doesn't have an unfulfilled Rendering dependency, and instead works just fine standalone (which means that ConditionalGet also doesn't have a Rendering dependency) 2009-12-20 18:50:54 -08:00
David Heinemeier Hansson
eeda059818 Just a little tidying 2009-12-20 18:37:09 -08:00
David Heinemeier Hansson
91ce8d8b7f Merge branch 'master' of github.com:rails/rails 2009-12-20 18:32:35 -08:00
David Heinemeier Hansson
cf9d6a95e8 Added ActionDispatch::Request#authorization to access the http authentication header regardless of its proxy hiding [DHH] 2009-12-20 18:30:50 -08:00
David Heinemeier Hansson
36c13cc07a Rename RenderOptions to Renderers 2009-12-20 18:15:20 -08:00
Joshua Peek
29c8a43056 Rename RackConvenience => RackDelegation 2009-12-20 20:05:26 -06:00
Joshua Peek
0f8a5c7954 Merge Session stuff into RackConvenience 2009-12-20 20:00:04 -06:00
David Heinemeier Hansson
9b41e1e4d8 Renamed Redirector to Redirecting (its a module, not a class) 2009-12-20 17:25:13 -08:00
David Heinemeier Hansson
83f4d86a93 Rename the RenderingController module to just plain Rendering 2009-12-20 17:15:31 -08:00
David Heinemeier Hansson
c06aff0a7e Added cookies.permanent, cookies.signed, and cookies.permanent.signed accessor for common cookie actions [DHH] 2009-12-20 14:33:13 -08:00
Yehuda Katz
e48b4c2dd0 :to => redirect() can take a String using 1.9-style interpolation or proc that takes the path parameters as a Hash 2009-12-20 14:07:32 -08:00
Yehuda Katz
8b4735fbd9 Add active_support/ruby/shim to the default requirements for AP components 2009-12-20 14:06:40 -08:00
Joshua Peek
2419fae092 Pending tests for AD Response 2009-12-17 22:10:37 -06:00
David Heinemeier Hansson
fa575973b1 Added alert/notice from 2-3-stable and refactored redirect_to into just living in Redirector [DHH] 2009-12-17 16:37:11 -08:00
Joshua Peek
7217d64f61 Use AbstractController error constants 2009-12-16 16:11:42 -06:00
Joshua Peek
7ee5843c3c Fully expand relative rails framework paths and make sure we aren't
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Joshua Peek
5f8e48cbd2 Move route reloading into railties 2009-12-14 17:54:41 -06:00
Joshua Peek
ec99eca013 Fix loading plugin and engine route sets 2009-12-14 16:51:13 -06:00
Joshua Peek
70c3e825fc Fix response_body warning in AC 2009-12-14 16:07:46 -06:00
Joshua Peek
1c52bca266 Fix warning in AC flash 2009-12-14 15:54:27 -06:00
Joshua Peek
2130566acf Fix warnings in AD::Response 2009-12-14 15:47:52 -06:00
Joshua Peek
39b708be96 rendering controller needs base 2009-12-12 19:50:12 -06:00
Joshua Peek
289c9a24fc Nearly all AC modules can be deferred 2009-12-12 19:41:58 -06:00
Joshua Peek
9cc9949817 All AbstractController modules are deferrable 2009-12-12 19:28:03 -06:00
Joshua Peek
4b4e517bf1 Relocate AbstractController exceptions into their proper parent modules 2009-12-12 18:48:34 -06:00
Joshua Peek
018dafe574 Allow autoloads to opt out of eager loading 2009-12-12 18:41:26 -06:00
Joshua Peek
ee395fe626 TestProcess belongs in AD 2009-12-12 18:09:44 -06:00
Joshua Peek
2297eaed5b "new" and "edit" name routes always need to be prepend to the
named_route [#3561 state:resolved]
2009-12-11 12:46:50 -06:00
Joshua Peek
61e9f2023b Use rackmounts recognize api and don't piggyback recognize_path on
top of rack call
2009-12-11 00:11:16 -06:00
Joshua Peek
588225f885 Remove fancy method not allowed resource exceptions since they are
too much of a hack
2009-12-11 00:01:22 -06:00
Joshua Peek
2f90d70049 Kill RouteSet#recognize 2009-12-10 23:45:04 -06:00
Joshua Peek
d1191507bc Cleanup generate_extras build/parse mess 2009-12-10 22:57:07 -06:00
Joshua Peek
1b82590c36 Reduce usage of interpret_status. It should also return a integer
not a string.
2009-12-10 22:02:50 -06:00
Nathan Weizenbaum
c517a4fb9a Add autoloads for ActionView::Template* classes, and an ActionView::TemplateError alias for ActionView::Template::Error.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-10 13:11:21 -08:00
Yehuda Katz
8b9275340f Merge branch 'master' of github.com:rails/rails 2009-12-10 13:11:15 -08:00
Joshua Peek
ec5434c3c2 Check block arity passed to routes draw so you don't need to use
|map|
2009-12-09 20:46:32 -06:00
Carlhuda
f9d570bdd8 Simpler RenderOption API -- removes the need for registering the types and extending a module 2009-12-09 13:40:49 -08:00
Joshua Peek
511cef296b Tack format onto resource routes 2009-12-08 17:19:49 -06:00
Joshua Peek
ce5f27b04b Remove double scoping blocks and just use one 2009-12-08 16:13:00 -06:00
Joshua Peek
c4df6332a4 Seperate scope level for nesting resources 2009-12-08 16:06:46 -06:00
Joshua Peek
33658ea1ae Don't use name prefix by itself unless as is an empty string 2009-12-08 15:50:44 -06:00
Joshua Peek
3d91d7f0a2 Routes added under resource collection should be prefixed with
resource collection name
2009-12-08 15:31:56 -06:00
Joshua Peek
1fc58a889d Fixed named prefix scope in resource member and collection actions 2009-12-07 20:57:01 -06:00
Joshua Peek
0c34e3f41a Ignore name_prefix unless there is an explicit name 2009-12-07 20:11:57 -06:00
Joshua Peek
81d7227c9b Move base mapper methods into Base module so plugins can easily
extend the mapper
2009-12-07 19:59:23 -06:00
Joshua Peek
e86a82c52c Move name_prefix merging into Scoping concern 2009-12-07 19:50:13 -06:00
Joshua Peek
e600b41c7f Cleanup resource scoping by passing down the parent resource object
in the scope
2009-12-07 19:47:47 -06:00
Joshua Peek
5835447b6f named_prefix doesn't join with "_" 2009-12-07 19:31:29 -06:00
Joshua Peek
e8489b43e2 Allow name_prefix to be pass into scope 2009-12-07 19:24:33 -06:00
Joshua Peek
40ad54e381 Allow scope to take :path and :controller options 2009-12-07 18:28:02 -06:00
Joshua Peek
66375434b6 Pass symbol in as route name when match is used with a symbol 2009-12-07 17:22:09 -06:00
José Valim
2ecfa817c9 Responder redirects to resource if destroy fails.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-07 15:05:27 -08:00
José Valim
324fa688fc Make controller.flash public to be used in responders.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-07 15:05:12 -08:00
Yehuda Katz
96e0638ce2 Should fix a few Sam Ruby fails. 2009-12-03 09:06:01 -08:00
Carlhuda
c1304098cc Reorganize autoloads:
* A new module (ActiveSupport::Autoload) is provide that extends
    autoloading with new behavior.
  * All autoloads in modules that have extended ActiveSupport::Autoload
    will be eagerly required in threadsafe environments
  * Autoloads can optionally leave off the path if the path is the same
    as full_constant_name.underscore
  * It is possible to specify that a group of autoloads live under an
    additional path. For instance, all of ActionDispatch's middlewares
    are ActionDispatch::MiddlewareName, but they live under 
    "action_dispatch/middlewares/middleware_name"
  * It is possible to specify that a group of autoloads are all found
    at the same path. For instance, a number of exceptions might all
    be declared there.
  * One consequence of this is that testing-related constants are not
    autoloaded. To get the testing helpers for a given component,
    require "component_name/test_case". For instance, "action_controller/test_case".
  * test_help.rb, which is automatically required by a Rails application's
    test helper, requires the test_case.rb for all active components, so
    this change will not be disruptive in existing or new applications.
2009-12-02 20:01:08 -08:00
Joshua Peek
399909b11c Use to_query in route query string generation 2009-12-02 15:23:26 -06:00
Joshua Peek
8db038227c Move controller namespace tracking into route set so it gets
reloaded in dev mode
2009-12-02 14:10:22 -06:00
Joshua Peek
4dee277a9b Stop escaping "[]" in query string 2009-12-02 12:46:14 -06:00
Joshua Peek
84be6cfb64 Fork rack build nested query to support to_param 2009-12-02 12:33:33 -06:00
Jeremy Kemper
de40bc033a Ensure Cache-Control max-age is an integer 2009-12-02 03:23:00 -08:00
Joshua Peek
ad26f066fe Response#write is defined twice (this is why -w is good) 2009-12-01 23:29:28 -06:00
Joshua Peek
f22db809c9 Response#cache_control is defined later 2009-12-01 23:27:40 -06:00
Joshua Peek
75ae5bb022 cache_store and page_cache_directory are already defined in caching
and pages
2009-12-01 23:14:03 -06:00
Joshua Peek
97be8537eb Fix @renderer warning 2009-12-01 22:58:56 -06:00
Joshua Peek
2fbd6f46fd Simply track controller namespaces instead of a complete list of
possible controllers to route to
2009-12-01 22:48:42 -06:00
Joshua Peek
7fe19d415a Make recognize try to constantize controller to see if it exists 2009-12-01 22:22:48 -06:00
Joshua Peek
44587b7fae Merge branch 'master' of github.com:rails/rails 2009-12-01 14:53:39 -06:00
Joshua Peek
61a31f3d3d Fix generating params with optional defaults [#3404 state:resolved] 2009-12-01 14:52:19 -06:00
José Valim
6e30361260 Allow ActionController::Responder to have a common entry point for all formats.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-01 08:23:43 -08:00
Joshua Peek
075f50d62c Fix some nested resource generation tests 2009-11-29 18:17:14 -06:00
Joshua Peek
f69f9820ee Wrap up http related routing helpers 2009-11-29 17:45:12 -06:00
Joshua Peek
312c3bfa24 Break down long match routing method 2009-11-29 17:39:37 -06:00
Joshua Peek
5da01a92c7 Make use of extract_options! 2009-11-29 17:01:14 -06:00
Joshua Peek
40ae2070d5 Extract Resource and SingletonResource helper objects 2009-11-29 16:59:44 -06:00
Joshua Peek
3f025e6408 Resource collection should be defined before member routes 2009-11-29 15:23:27 -06:00
Bryan Helmkamp
bb84cab2fc Update reference to deprecated constant to avoid warnings 2009-11-28 23:41:03 -08:00
Yehuda Katz
45d8ff08a4 Remove reference to class that doesn't exist (ht: brynary) 2009-11-28 21:36:58 -08:00
Joshua Peek
59dbae145b Privatize Routing.possible_controllers and fix brittle url helper
controller test loading.
2009-11-23 21:50:21 -06:00
Joshua Peek
15ab3a98a1 Find all controllers in memory to use for routing 2009-11-23 20:20:50 -06:00
Joshua Peek
f987e8561c with_controllers is no longer used 2009-11-23 19:45:42 -06:00
Joshua Peek
8d351eac07 Extract Routing.controller_constraints 2009-11-23 19:44:43 -06:00
Joshua Peek
01c9f99c53 Kill dead routing internals helpers 2009-11-23 19:17:53 -06:00
Joshua Peek
ef771552b7 Don't really care about reloading routes when inflections are
changed.
2009-11-23 18:59:48 -06:00
Joshua Peek
4b325fcd1a Update routing for rackmount 0.2 api changes 2009-11-19 17:58:57 -08:00
Joshua Peek
5df26dd7a9 Add basic nested named route support to new routing dsl. Also add a
bunch of pending tests.
2009-11-19 09:04:53 -08:00
Jeremy Kemper
e1385be025 Extract form_authenticity_param instance method so it's overridable in subclasses 2009-11-17 23:40:06 -08:00
Will Read
7fadb3f261 Allow explicit placement of hidden id element for nested models.
[#3259 state:resolved]

Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-11-15 21:47:57 +01:00
Jeremy Kemper
3f54f3100b Ruby 1.9.2: StringIO no longer has #path 2009-11-13 13:10:28 -08:00
José Valim
2cb47c742f Split mime responder into smaller chunks and allow action to be configured.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-11-13 09:52:52 -08:00
Joshua Peek
a28d0ea33e Remove rackmount const usage 2009-11-12 23:33:30 -06:00
David Vrensk
af44b07649 Rdoc for changes introduced in e2ed1a1ca, 36058f450.
[#3451 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-11-12 11:21:44 -08:00
Jeremy Kemper
631a27d6a5 Revert "Revert "Eliminate warning with layout is unset""
This reverts commit d8fd0499bfd6edc676ff3fbffc327656f6d5c320.
2009-11-10 16:15:43 -08:00
Jeremy Kemper
d8fd0499bf Revert "Eliminate warning with layout is unset"
This reverts commit 1fcf32f8fef8fb5a63a66edacf556a107d12c049.
2009-11-10 16:09:52 -08:00
Jeremy Kemper
1fcf32f8fe Eliminate warning with layout is unset 2009-11-10 15:48:03 -08:00
Jeremy Kemper
6480850d37 Revert "Eliminate warning with layout is unset"
This reverts commit 90be80361f26d717f9842170315dd8659f35429d.
2009-11-10 15:43:37 -08:00
Jeremy Kemper
be664392c0 Eliminate warning by initializing nil formats 2009-11-10 14:13:54 -08:00
Jeremy Kemper
90be80361f Eliminate warning with layout is unset 2009-11-10 14:13:21 -08:00
Joshua Peek
1004fcb767 Fixed AD assertion autoloads [#3470 state:resolved] 2009-11-09 21:38:01 -06:00
Xavier Noria
004db18cb0 String#bytesize is not needed for Ruby >= 1.8.7 2009-11-09 22:16:51 +01:00
Xavier Noria
f8e713f488 Object#tap is not needed for Ruby >= 1.8.7 2009-11-09 22:16:51 +01:00
Bryan Helmkamp
047007fa9d Silence warning: discarding old h 2009-11-09 15:44:36 -05:00
Bryan Helmkamp
afc129e270 Fix some Ruby warnings: `*' interpreted as argument prefix 2009-11-09 14:46:29 -05:00
Joshua Peek
c10f4ae01d Merge remote branch 'Fingertips/master' 2009-11-08 16:03:15 -06:00
Jeremy Kemper
a595abff21 Unknown :format param should result in empty request.formats 2009-11-08 12:12:58 -08:00
Yehuda Katz
e1b5e3cc70 Break up inflector to reduce the dependency burden on dependency-les methods like constantize. 2009-11-07 11:23:21 -08:00
Chris Hapgood
c2cfb20198 Share ActionView::TestCase's output_buffer with view for concat support.
[#3467 state:resolved]

Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-11-07 00:42:07 +01:00
Nathan Weizenbaum
cbded53671 When rendering layouts with blocks, use #capture to avoid assuming that the return value is the block's content.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-11-05 20:08:04 -08:00
Jeremy Kemper
1c047be0fc If class doesn't have a name, there's no implied layout name, so don't set up a _layout method 2009-11-05 16:12:02 -08:00
Yehuda Katz
b12f194c39 Update AC::Middleware to play better with the normal AC::Metal stack. This required stopping to use #call for non-rack-related stuff 2009-11-05 15:38:25 -08:00
Jeremy Kemper
a8ed10546d Ruby 1.9: don't assume params are US-ASCII. Hands off the encoding. 2009-11-04 16:27:54 -08:00
Joshua Peek
f950d0b4af Fix simple resource named routes for new routing dsl 2009-11-03 11:23:22 -06:00
Jeremy Kemper
b540eca588 Consolidate Object#to_param and #to_query core extensions 2009-11-02 17:50:12 -08:00
José Valim
976c264724 Extracted localized_cache.rb from ActionController, added it to AbstractController and made ActionMailer use it. 2009-11-01 02:23:49 +01:00
José Valim
0396004861 Add some basic render_test to AbstractController. 2009-11-01 02:23:48 +01:00
José Valim
0cf16ddb88 Improve AbstractController layouts coverage. 2009-11-01 02:23:48 +01:00
José Valim
43d5504f0a Move all render and layout pieces required in ActionMailer from ActionController to AbstractController. 2009-11-01 02:23:48 +01:00
José Valim
684c2dc208 Remove ActionMailer helpers and rely on AbstractController one. 2009-11-01 02:23:48 +01:00
José Valim
a9751a7034 Refactor ActionMailer layout and remove legacy one. 2009-11-01 02:23:47 +01:00
Yehuda Katz
51c24ae3e3 Caching refactoring 2009-10-29 00:44:12 -04:00
Yehuda Katz
8dcf91ca11 First pass at cleaning up action caching 2009-10-28 16:54:00 -04:00
José Valim
427a7385eb Make polymorphic_url work with symbols again and refactor it [#1384 status:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-28 14:13:48 -05:00
Yehuda Katz
654b33afc5 New semantics eliminate the need for __send__ 2009-10-28 01:43:46 -07:00
Yehuda Katz
c5e73b8976 Reduce TextTemplate cost for simple cases 2009-10-28 00:13:08 -07:00
Yehuda Katz
0b2dd7afd9 Reorganize CSRF a bit 2009-10-28 00:12:35 -07:00
Yehuda Katz
cbcb947b00 AS::Notifications.subscribe blocks are now yielded the arguments to pass to AS::Notifications::Event.new 2009-10-27 21:04:53 -07:00
Yehuda Katz
c3fa20883e #include should be #extend 2009-10-27 09:21:01 -07:00
Yehuda Katz
4653719aa6 Clean up flash a bit 2009-10-27 09:15:41 -07:00
Yehuda Katz
df06e0bd86 Clean up flash a bit 2009-10-26 23:11:52 -07:00
Yehuda Katz
2bdd8fa863 Clean up parameter logging some 2009-10-26 21:31:37 -07:00
Yehuda Katz
000d593621 Clean up and update cookies 2009-10-26 18:01:09 -07:00
Yehuda Katz
e1786ee6eb Fixes expires_now and cleans things up a bit 2009-10-26 17:32:42 -07:00