Commit Graph

4101 Commits

Author SHA1 Message Date
José Valim
c34d6279a0 Allow radio buttons to work with booleans.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 18:02:07 +01:00
rizwanreza
1191e3ffaf Add :include_blank option for select_tag [#1987 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:58:27 +01:00
Niklas Holmgren
c284412b14 Polymorphic routes generates collection URL from model class [#1089 state:resolved]
Signed-off-by: Dan Pickett <dpickett@enlightsolutions.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:00:29 +01:00
Yehuda Katz
ad98827a78 Merge commit 'jose/responder' 2009-08-08 12:54:02 -03:00
José Valim
6e0ac748e4 Renamed ActionController::Renderer to ActionController::Responder and ActionController::MimeResponds::Responder to ActionController::MimeResponds::Collector. 2009-08-08 17:48:07 +02:00
Yehuda Katz
efcfce50c4 Fixes "Cached fragment hit" written to log even if fragment is not cached (Erik Andrejko) [#2917 state:resolved] 2009-08-08 12:46:44 -03:00
Yehuda Katz
d0301e13f4 First pass at making partial rendering an Object. More cleanup to come. 2009-08-08 12:44:26 -03:00
Steve St. Martin
a8645593a4 remove duplicate call to stringify_keys [#2587 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-08 13:56:41 +02:00
wmoxam
98450fd168 Fix number_to_precision rounding error [#2071 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 02:05:10 +01:00
Jeremy Kemper
43b406bdb0 Ruby 1.9 compat: fix route recognition encoding test 2009-08-07 17:16:34 -07:00
Jeremy Kemper
12c271d1d2 Ruby 1.9.2: implicit argument passing of super from method defined by define_method() is not supported 2009-08-07 17:04:56 -07:00
Yehuda Katz
010a0c92eb Rename find_by_parts and find_by_parts? to find and exists? 2009-08-07 15:00:12 -03:00
José Valim
aed135d3e2 Renamed presenter to renderer, added some documentation and defined its API. 2009-08-07 17:17:51 +02:00
José Valim
1fd65c80fc Encapsulate respond_with behavior in a presenter. 2009-08-07 17:16:16 +02:00
José Valim
7034272354 Add destroyed? to ActiveRecord, include tests for polymorphic urls for destroyed objects and refactor mime responds tests and documentation. 2009-08-07 17:16:16 +02:00
José Valim
f59984cc81 Add nagivational behavior to respond_with. 2009-08-07 17:16:15 +02:00
José Valim
e45e120af9 Merge branch 'master' of git://github.com/rails/rails into old 2009-08-07 17:13:44 +02:00
Yehuda Katz
bfe58ac05d Get all ActionController partial rendering to use ActionView's partial code. Consequences:
* It is not possible to always pre-determine the layout before going to ActionView.
    This was *already* broken for render :partial => @object, :layout => true. This is
    now handled by overriding render_to_body in layouts.rb and manually injecting the
    partial's response. This needs to be done in ActionController since ActionController
    knows enough to get _layout_for_option. There is probably a better abstraction here.
  * As a result, all partial rendering can correctly restrict their layouts to the mime
    type of the rendered partial. This could have previously caused a bug in some edge cases.
  * If other layout-like options are added, they might need to add special code for the
    case of render :partial. We should try to think of an alternate solution, if possible,
    but this works for the cases we know of now.
2009-08-07 11:33:54 -03:00
José Valim
dac8927b05 Merge branch 'master' of git://github.com/rails/rails into old 2009-08-07 16:10:17 +02:00
Yehuda Katz
606e950ccb Whitespace 2009-08-07 06:32:54 -03:00
Yehuda Katz
d94ba11295 Continue reworking the partial path.
* TODO: Review ActionController calling render_template for certain partials.
    Might we be able to save logic by always delegating to AV's render_partial?
2009-08-07 06:32:17 -03:00
Yehuda Katz
493d84ce2f Modify various partial methods to carry along the block that can be passed in with render
* _render_single_template, which renders a template without layout
  * _render_partial_unknown_type, which renders a partial of unknown type
    (the entry method for most partial rendering; supports strings, objects, and collections)
  * _render_partial_object, which renders a partial for a single object.
  * extracted _render_partial_path so it can be used to render the spacer without going
    through the public render :partial
2009-08-07 05:40:01 -03:00
Yehuda Katz
59e475e3a6 Some more AV work:
* rename _render_partial to _render_partial_unknown_type to reflect that for this call, 
  	we don't know the type.
  * Merge _render_partial_with_block and _render_partial_with_layout to _render_partial
    * TODO: Check to see if any more logic can be shared
    * TODO: See about streamlining block path so we can get rid of @_proc_for_layout
  * Remove @exempt_from_layout as it is no longer needed
2009-08-07 03:48:28 -03:00
Yehuda Katz
0612fd0f09 Replace _render_template_with_layout with _render_template since the layout is optional 2009-08-07 03:18:45 -03:00
Yehuda Katz
b3e199f698 Some more AV refactoring:
* remove no longer used _array_like_objects
  * _render_content_with_layout renamed to _render_content since layout it optional
  * remove check for optional layout before _render_content
2009-08-07 02:46:21 -03:00
Yehuda Katz
8534c5bf19 Start cleaning up partial path 2009-08-07 01:51:50 -03:00
Yehuda Katz
9b506484f1 This is handled by the resolver now 2009-08-07 01:51:32 -03:00
Yehuda Katz
70a440aa27 Clean up render @object a bit more. 2009-08-07 00:52:13 -03:00
Yehuda Katz
4ac9d391d3 Improve a path in _render_partial 2009-08-06 23:42:11 -03:00
Yehuda Katz
0435178ff8 Remove file that doesn't seem to be used anymore 2009-08-06 22:57:42 -03:00
Yehuda Katz
71638e6760 Move AbstractController to a top-level component 2009-08-06 22:51:24 -03:00
Yehuda Katz
16c01224cb ActionController::Metal#to_rack converted to #to_a to match normal rack convention 2009-08-06 20:05:14 -03:00
Yehuda Katz
70d779aaea Update _render_options to reflect the fact that they're public 2009-08-06 20:03:59 -03:00
Yehuda Katz
bd6b61be88 Rename /base to /metal and make base.rb and metal.rb top-level to reflect their module locations 2009-08-06 19:52:11 -03:00
Yehuda Katz
52798fd479 rename ActionController::Http to ActionController::Metal at Josh's suggestion 2009-08-06 19:50:22 -03:00
Yehuda Katz
af375a5eb3 Replace _action_view with view_context to reflect that it is public and that it does not need to be an ActionView instance 2009-08-06 19:45:40 -03:00
Yehuda Katz
f0945409d9 replace _render_*_from_controller with render_* as they are intended to be public 2009-08-06 19:43:28 -03:00
Matthew Rudy Jacobs
64268a0b06 Make sure javascript_include_tag/stylesheet_link_tag does not append ".js" or ".css" onto external urls [#1664 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-05 15:58:55 +01:00
Yehuda Katz
b53f006901 Remove legacy processing and content_length
* convert_content_type! is handled by assign_default_content_type_and_charset!
  * set_content_length! should be handled by the endpoint server. Otherwise
    each middleware that modifies the body has to do the expensive work of
    recalculating content_length.
  * convert_language! appears to be legacy. There are no tests for this
  * convert_cookies! should be handled by the new HeaderHash in Rack
  * Use an integer for .status's internal representation to avoid needing to
    do String manipulation just to find out the status
2009-08-02 19:39:33 -04:00
Yehuda Katz
503ce1d01c Update cache_control to be a Hash of options that is used to build the header.
* Significantly simplifies setting and modifying cache control in other areas
2009-08-02 19:39:33 -04:00
Jeremy Kemper
f2a35723c8 Ruby 1.9: fix encoding for test_file_stream 2009-08-01 20:26:05 -07:00
Sava Chankov
ec94c2550d Ruby 1.9: fix Content-Length for multibyte send_data streaming
[#2661 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-01 20:25:59 -07:00
José Valim
b2d24baf79 Added tests for nested resources. 2009-07-31 20:56:53 +02:00
José Valim
5b7e81efec Allow respond_with to deal with http verb accordingly. 2009-07-31 11:59:05 +02:00
José Valim
7a4a679dba Remove any resource logic from respond_to. 2009-07-30 22:43:37 +02:00
Marc Love
d860c89170 Fix tag helpers so that all HTML element boolean attributes render according to the specs. Added all boolean attributes listed in the XHTML 1.0 specs (http://www.w3.org/TR/xhtml1/guidelines.html) and HTML 5 specs (http://www.whatwg.org/specs/web-apps/current-work). HTML 5 boolean attribute rendering was broken in commit 1e2d7229602f467cfdc0ef606b5ef8a5566a1501 / [#2864 state:resolved].
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-30 09:48:27 -07:00
José Valim
d209aea7d8 Remove last TODO.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:04 -07:00
José Valim
fa0cf663fe Add a couple more tests to respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
09de34ca56 Added respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
bbe86077c2 Added tests for respond_to class method.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00