David Heinemeier Hansson
cc6fa2f4d7
Fix alias_method, add test
2011-03-27 11:20:54 -07:00
Emilio Tagua
97174980e5
Remove duplicated method.
2010-09-28 15:43:03 -03:00
Rodrigo Dominguez
aa054c35f7
link_to_function now expects a piece of javascript code for the onclick parameter
...
[#5179 ]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-07-29 13:11:53 -03:00
Carlos Antonio da Silva
751f89b8b2
Add assertion to link_to_function test with block and capture, and more expressive test name [ #5179 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-25 23:00:15 +02:00
Sebastian A. Espindola
8d5b792e7d
Fixed output_buffer encoding problem [ #5179 ]
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-25 16:33:04 +02:00
Joshua Peek
d69e5616e8
link_to_function is here to stay
2010-03-16 22:06:16 -05:00
Carlhuda
4464b8e87b
Deprecate block_called_from_erb? pending a solution for getting it into apps
2010-03-09 23:44:12 -08:00
José Valim
c7564d74e8
Added template lookup responsible to hold all information used in template lookup.
2010-03-07 19:41:58 +01:00
Carlhuda
b85ea58eb5
Change AV formats so they can delegate to the controller. Now users (or plugins) can override details_for_render in their controllers and add appropriate additional details. Now if only they could *do* something with those details...
2010-03-01 14:37:05 -08:00
Joshua Peek
b3787643ec
Move link_to_function and link_to_remote into prototype_legacy_helper
...
plugin
2010-01-30 15:20:00 -06:00
David Heinemeier Hansson
2c2b84f93c
Javascript tests expects the old default of escaping HTML, make it so for now
2010-01-10 18:25:17 -08:00
Yehuda Katz
1310231c15
Got tests to pass with some more changes.
...
* request.formats is much simpler now
* For XHRs or Accept headers with a single item, we use the Accept header
* For other requests, we use params[:format] or fallback to HTML
* This is primarily to work around the fact that browsers provide completely
broken Accept headers, so we have to whitelist the few cases we can
specifically isolate and treat other requests as coming from the browser
* For APIs, we can support single-item Accept headers, which disambiguates
from the browsers
* Requests to an action that only has an XML template from the browser will
no longer find the template. This worked previously because most browsers
provide a catch-all */*, but this was mostly accidental behavior. If you
want to serve XML, either use the :xml format in links, or explicitly
specify the XML template: render "template.xml".
2009-08-15 12:32:02 -07:00
Yehuda Katz + Carl Lerche
6923b392b7
Added the :rjs render option
2009-05-21 16:35:40 -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
6c05b5e938
Temporarily modifies setup to call super directly. This can support more T::U runners.
2009-04-08 17:33:41 -07:00
Yury Kotlyarov
9b8cde41bc
Remove duplicate test [ #2136 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-08 15:50:38 +00:00
Yehuda Katz
eb9af20b7c
Begin unifying the interface between ActionController and ActionView
2009-01-22 16:18:10 -06:00
Joshua Peek
229eedfda8
Cache JavaScriptGenerator's helper module set on the template
2008-08-26 12:17:55 -05:00
Joshua Peek
f2d8d13c64
Performance: Cache modules that extend the view context for JavaScriptGenerator
2008-08-25 21:50:26 -05:00
Jeremy Kemper
ecc0543525
JavaScriptGenerator should only sets output_buffer for the duration of the update block
2008-07-15 18:42:22 -07:00
Joshua Peek
aca246ab25
Get buffer for fragment cache from template's @output_buffer
2008-07-15 14:43:52 -05:00
Michael Koziarski
e358b1fce8
Remove old method of including javascripts define_javascript_functions.
...
javascript_include_tag and friends do a much better job.
2008-07-03 19:21:04 +03:00
Jeremy Kemper
72f93b581f
Check whether blocks are called from erb using a special __in_erb_template variable visible in block binding.
2008-06-19 22:21:56 -07:00
Jeremy Kemper
ff5f155f8d
Use output_buffer reader and writer methods exclusively instead of hitting the instance variable so others can override the methods.
2008-06-08 20:05:39 -07:00
Jeremy Kemper
e732a405ab
javascript_tag should only concat when block_given?
2008-06-06 17:59:41 -07:00
Jeremy Kemper
0bdb7d353b
Work with @output_buffer instead of _erbout
2008-06-02 21:32:50 -07:00
Joshua Peek
17d4164a16
Introduce ActionView::TestCase for testing view helpers.
2008-04-19 13:08:24 -05: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
Michael Koziarski
92f02adf40
Don't escape forward slashes with String#to_json, our unicode encoding of < and > prevent the XSS problems. [tpope] Closes #10273
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8255 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-02 08:45:35 +00:00
Rick Olson
c708346688
Change JSON to encode %w(< > &) as 4 digit hex codes to be in compliance with the JSON spec. Closes #9975 [josh, chuyeow, tpope]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8050 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-29 00:18:43 +00:00
Rick Olson
d7aa32d5d0
Update tests for ActiveSupport's JSON escaping change. [rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8034 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 05:32:30 +00:00
David Heinemeier Hansson
f0dc2774e8
Improve tests ( closes #7240 ) [josh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7581 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 23:11:45 +00:00
David Heinemeier Hansson
da5d8fa6ad
Fixed JavaScriptHelper#escape_javascript to also escape closing tags ( closes #8023 ) [rubyruy]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7567 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:31:44 +00:00
David Heinemeier Hansson
0b0931e150
Added block-acceptance to JavaScriptHelper#javascript_tag ( closes #7527 ) [BobSilva/tarmo/rmm5t]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 21:34:25 +00:00
Jeremy Kemper
71b77a3d6a
Improve helper test coverage. Closes #7215 , #7233 , #7234 , #7235 , #7236 , #7237 , #7238 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7011 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-13 01:20:55 +00:00
Jeremy Kemper
a308ff0cdd
Test javascript_tag. Closes #7239 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6977 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-08 22:20:18 +00:00
Jeremy Kemper
34b94de8b8
Improve Action View test coverage. Closes #7241 , #7243 , #7244 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6967 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-08 04:00:15 +00:00
Rick Olson
32b307bc32
fix test cases to match new json output. Closes #8371
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 09:42:13 +00:00
Jeremy Kemper
0eacdcf9a3
Use a consistent load path to avoid double requires. Fix some scattered Ruby warnings.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6057 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 07:16:55 +00:00
David Heinemeier Hansson
4b3e964a1a
Fixed escaping of backslashes in JavaScriptHelper#escape_javascript ( closes #6302 ) [sven@c3d2.de]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5242 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 00:34:43 +00:00
David Heinemeier Hansson
8c9ce617c9
Fixed JavaScriptHelper#link_to_function and JavaScriptHelper#button_to_function to have the script argument be optional [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5039 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-06 01:31:04 +00:00
Sam Stephenson
9d8e34808f
Change link_to_function and button_to_function to (optionally) take an update_page block instead of a JavaScript string. Closes #4804 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-19 18:08:15 +00:00
David Heinemeier Hansson
987d9dbf31
Added JavaScriptHelper#button_to_function that works just like JavaScriptHelper#link_to_function but uses a button instead of a href [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-31 04:31:10 +00:00
David Heinemeier Hansson
89d8afa2c4
Added that JavaScriptHelper#link_to_function will honor existing :onclick definitions when adding the function call [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-31 03:51:43 +00:00
David Heinemeier Hansson
341d34cd50
Added that JavaScriptHelper#link_to_function will honor existing :onclick definitions when adding the function call [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-31 03:50:08 +00:00
Sam Stephenson
d99ed9bd6a
Refactored JavaScriptHelper into PrototypeHelper and ScriptaculousHelper. Added PrototypeHelper::JavaScriptGenerator and PrototypeHelper#update_page for easily modifying multiple elements in an Ajax response.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3036 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-14 22:28:47 +00:00
Thomas Fuchs
56ae4ab547
Added support for the queue option on visual_effect
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2807 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-29 15:01:39 +00:00
Tobias Lütke
f60f76eab0
modified javascript_helper testcase to back up #2097
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2550 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-13 17:39:14 +00:00
Sam Stephenson
f49dc37e71
Wrap javascript_tag contents in a CDATA section and add a cdata_section method to TagHelper. Closes #1691 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2543 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-12 22:47:39 +00:00
Thomas Fuchs
516dc2c0f1
Update script.aculo.us to 1.5_rc2, and Prototype to 1.4.0_pre7
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 08:20:47 +00:00