Commit Graph

1554 Commits

Author SHA1 Message Date
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
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
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
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
0cf16ddb88 Improve AbstractController layouts coverage. 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
Yehuda Katz
8dcf91ca11 First pass at cleaning up action caching 2009-10-28 16:54:00 -04:00
Yehuda Katz
c5e73b8976 Reduce TextTemplate cost for simple cases 2009-10-28 00:13:08 -07:00
José Valim
9fbb2c571b Fix error_messages_for when instance variable names are given.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-21 11:18:36 -05:00
José Valim
cb87302689 Bring agnosticism to error_messages_for. 2009-10-17 13:03:28 -03:00
Yehuda Katz
7e9e370e03 Make encodings work with Erubis and 1.9 again 2009-10-16 17:28:44 -07:00
Yehuda Katz
a565c19c5b Fix a bug where templates with locales were not being sorted correctly 2009-10-16 11:26:19 -07:00
Jeremy Kemper
71f7e75d95 Merge branch 'master' into orchestra 2009-10-15 17:36:54 -07:00
José Valim
2d7abe245e Renamed Orchestra to Notifications once again [#3321 state:resolved] 2009-10-15 18:51:51 -03:00
Yehuda Katz
e1490d4e4c Change config implementation in AV slightly 2009-10-15 14:41:59 -07:00
José Valim
a15e02d44a Unify benchmark APIs. 2009-10-15 18:19:25 -03:00
José Valim
af0d1fa892 Update Orchestra instrumentations and move part of logging to Orchestra. 2009-10-15 18:18:44 -03:00
José Valim
8b340ab2f6 Revert "Rename Orchestra to Notifications [#3321 state:resolved]"
This reverts commit 8cbf825425dc8ad3770881ea4e100b9023c69ce2.
2009-10-15 18:06:15 -03:00
Yehuda Katz
cb8b0f4a5a Make this less brittle and work on 1.8 2009-10-15 13:35:22 -07:00
Michael Koziarski
b1201792a7 Make the erubis implementation easier for plugins to change. 2009-10-15 17:54:01 +13:00
Michael Koziarski
cc1ad46ead Add a read-only method which plugin authors can use to determine if xss escaping.
This doesn't provide a way to turn off the escaping, but alternative template engine authors
can figure out what their default should be by calling this.  Avoids a messy version + plugin check.
2009-10-15 17:22:50 +13:00
Joshua Peek
8cbf825425 Rename Orchestra to Notifications [#3321 state:resolved] 2009-10-14 19:50:36 -05:00
Michael Koziarski
1d01bad3ce Make sure non-escaped urls aren't considered safe 2009-10-15 09:58:35 +13:00
Michael Koziarski
5d5e34fa52 Use ERB::Util.h over CGI.escapeHTML as the former is safety aware and the latter isn't 2009-10-15 09:58:17 +13:00
Phil Darnowsky
1b3195b63c ActionView.url_for doesn't escape by default
ActionView::Helpers::UrlHelper#url_for used to escape the URLs it generated by
default.  This was most commonly seen when generating a path with multiple
query parameters, e.g.

  url_for(:controller => :foo, :action => :bar, :this => 123, :that => 456)

would return

  http://example.com/foo/bar?that=456&amp;this=123

escaping an ampersand that shouldn't be escaped.  This is both wrong and
inconsistent with the behavior of ActionController#url_for, and is changed.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-15 09:49:07 +13:00
Yehuda Katz
a41c6c35ca Start adding configuration to ActionView instead of using constants.
By using config rather than hardcoded constants, we can evolve the
  configuration system over time (we'd just need to update the config
  method with more robust capabilities and all consumers would get
  the capabilities with no code changes)
2009-10-14 13:36:41 -07:00
Yehuda Katz
b9ce8216fa Fix a bug where render :text could not handle yield :symbol. Fixes guides generation 2009-10-10 00:31:12 -10:00
Yehuda Katz
16a48a95e3 Fix issue with standalone ActionView 2009-10-09 00:55:00 -10:00
Yehuda Katz
ee37ff46e9 Get rid of constant name usage for stack trace help in favor of overriding #inspect and .name. 2009-10-09 00:53:48 -10:00
Carl Lerche
992c2db76c Finish porting over the initializers to the app object and fix all the tests 2009-10-08 18:12:28 -07:00
Joshua Peek
3b6bdfc105 API change: content_tag_for outputs prefixed class name 2009-10-08 14:13:49 -05:00
Carl Lerche
665c7ad29d Fix warning spew for 1.9 2009-10-08 10:58:04 -07:00
Michael Koziarski
c352ec060c error procs have to be safe too 2009-10-08 12:13:48 +13:00
Michael Koziarski
9415935902 Switch to on-by-default XSS escaping for rails.
This consists of:

  * String#html_safe! a method to mark a string as 'safe'
  * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it
  * Calls to String#html_safe! throughout the rails helpers
  * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB)
  * New ERB implementation based on erubis which uses a SafeBuffer instead of a String

Hat tip to Django for the inspiration.
2009-10-08 09:31:20 +13:00
Yehuda Katz
3916f0340e Not calling a private method anymore 2009-10-07 00:33:13 -10:00
Yehuda Katz
e57197a967 Fix warning spew 2009-10-06 22:36:14 -10:00
Joshua Peek
31319b471b NumberHelper depends on big decimal extensions 2009-10-03 22:06:25 -05:00
Erik Ostrom
8ffc2e3b8d Ported the new ActionView::TestCase from 2-3-stable to master [#3260
state:resolved]

The test case now mimicks the template environment more closely, so it's
possible to use render, load helper dependencies.

This also fixes assert_select, and similar assertions. Because view tests
and helpers generally don't render full templates assert_select looks
first in rendered and then in output_buffer to find the rendered output.

Additional `master'-only changes: Made the Action Pack Rakefile run the
ActionView::TestCase tests, and made ActionView::Rendering#_render_text
always return a string.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-28 13:31:30 -05:00
John Trupiano
c9318e9010 Introduce :almost keyword for distance_of_time_in_words. Make 1.75 days - 2 days return '2 days'.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3266 state:committed]
2009-09-28 14:37:31 +13:00
Jay Pignata
8ef1cd9733 Enhancing distance_of_time_in_words to prefix year output with over and about depending upon how many months have elapsed
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3106 state:committed]
2009-09-28 14:36:38 +13:00
Jeremy Kemper
0bd6e933c0 Restore split between require-time and runtime load path mungery. Simplifies vendor requires. 2009-09-24 18:38:18 -07:00
Joshua Peek
610b81beca Clean up log output for rendered templates 2009-09-24 12:30:13 -05:00
José Valim
8f47f311b7 Instrument process_action, render and sql. 2009-09-20 10:56:38 -03:00
José Valim
befec8a0d8 Remove unused code in ActionView.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-15 16:18:10 -07:00
Joshua Peek
b2f0b8cbda Rollback AS bundler work and improve activation of vendored dependencies 2009-09-13 22:55:46 -05:00
Joshua Peek
67eb892e94 AV::UrlHelper depends on Array#second 2009-09-13 17:25:40 -05:00
Joshua Peek
a9f5f4bb45 Don't force test suite to use bundler 2009-09-13 12:42:13 -05:00
Andrew France
1b78e9bba3 Allow fields_for on a nested_attributes association to accept an explicit collection to be used. [#2648 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 15:50:05 +02:00