Santiago Pastorino
6062d434f1
Allow view in AV::TestCase to access it's controller helpers methods
2011-01-12 12:14:00 -02:00
John Allison
5d1d9bfb05
Improve select helpers by allowing a selected value of false. This is useful when using a select helper with a boolean attribute, and the attribute is false. (e.g. f.select :allow_comments)
2011-01-09 15:45:55 -08:00
Rizwan Reza
18605adec3
HTML5 button_tag helper
...
This tag is similar in nature to submit_tag, but allows more control.
It also doesn't submit if submit type isn't used, allowing JavaScript to
control the flow where required.
For more information: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-button-element
2011-01-09 15:22:23 -08:00
Piotr Sarnacki
8e5d91062f
Don't be so picky on MissingTemplate error details, this fails randomly on 1.8.7 because of not ordered hash
2010-12-31 11:17:37 +01:00
Nick Sutterer
4c44f0468a
added tests for the MissingTemplate exception message.
2010-12-31 10:41:19 +01:00
Timothy N. Tsvetkov
e5b84fd723
ActionController::Base.helpers.sanitize ignores case in protocol
...
[#6044 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-12-30 22:43:43 -02:00
artemave
6c5a3bb312
all tests pass
2010-12-26 22:32:15 -08:00
Santiago Pastorino
5853583f9b
Allow registering javascript/stylesheet_expansions to existing symbols
2010-12-22 21:53:24 -02:00
Piotr Sarnacki
09195f10bd
Do not use the same hash instance for expansions [ #6114 state:resolved]
...
Using the same hash instance makes using the same expansions for
both javascripts and stylesheets.
2010-12-22 09:44:46 +01:00
Don Wilson
f71809f257
Fixed number_with_precision rounding error [ #6182 state:resolved]
2010-12-18 10:00:37 +01:00
Piotr Sarnacki
07567aea5f
Revert "Fixed number_with_precision rounding error [ #6182 state:resolved]"
...
This reverts commit 006ec77e60 .
2010-12-17 16:11:47 +01:00
Don Wilson
006ec77e60
Fixed number_with_precision rounding error [ #6182 state:resolved]
2010-12-17 11:32:19 +01:00
José Valim
cc70ac9508
Properly check the arity for template handlers.
2010-12-09 13:15:40 +01:00
Santiago Pastorino
b696dd70db
Allow back passing :rescue_format => nil and test added
2010-12-04 20:08:23 -02:00
Sven Fuchs
896e25e994
Make TranslationHelper#translate use the :rescue_format option in I18n 0.5.0
...
Don't catch exceptions here. Instead only declare that we want exceptions to be rescued as :html, but also let users configure reactions to exceptions in I18n.
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-12-04 18:00:52 +01:00
José Valim
8624065bff
Allow template handlers to store temp data.
2010-11-24 12:38:52 +01:00
Henning Koch
deff528947
Fix AssetIncludeTag ensuring that files are in the wrong directory [ #6015 state:resolved]
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-11-19 15:38:13 -02:00
José Valim
e3d8331c5b
Revert "Remove deprecated form_for with strings or symbols"
...
This code was not deprecated. What was deprecated is the following:
form_for(:foo, @foo)
Which now should be rewritten as:
form_for(@foo, :as => :foo)
The following format is valid:
form_for(:foo)
This reverts commit be797750e6 .
2010-11-18 20:22:14 +01:00
Leonardo Capillera
be797750e6
Remove deprecated form_for with strings or symbols
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-11-18 16:46:55 -02:00
José Valim
f14c2bf582
Pass the view object as parameter to the handler. Useful if you need to access the lookup context or other information when compiling the template.
2010-11-17 23:50:45 +01:00
Josh Kalderimis
6a609dbc82
incorporated most of the feedback from José
2010-11-16 00:04:37 +01:00
Josh Kalderimis
7a38c8b9f5
removed an assert from a test as it was testing a private method
2010-11-16 00:04:36 +01:00
Santiago Pastorino
e3b68e5f6b
Tests added for rendering partial with layout, when the partial contains another render layout with block call
2010-11-13 13:38:40 -02:00
Neeraj Singh
793967cd40
provide better error message if path is uri [ #5914 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-11-11 17:27:47 +01:00
Neeraj Singh
fbaf3a23d9
fields_for should treat ActiveRecord::Relation as an array
...
[#5795 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-11-11 17:14:47 +01:00
Carlos Antonio da Silva
7846fb79e1
Fix render partial with layout and no block
...
When using a render :partial with :layout call, without giving a block,
if the given :partial had another render :partial call, the layout was
not being rendered. This commit fixes this context by storing variables
before rendering the partial, so they are not overrided in any successive
call to render partials down the path. All ActionPack tests are ok.
2010-11-11 16:22:39 +01:00
Carlos Antonio da Silva
50c7aab996
Fix issue with rendering partials and then yielding inside a render layout call
...
The given block was never being executed when another render :partial call
existed before the yield call, due to the block being overriden.
This commit also adds some more tests to render with :layout option.
2010-11-11 16:22:39 +01:00
Aditya Sanghi
920660b19c
patching to ensure separator is printed with order [ #5816 state:resolved]
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-11-11 12:22:15 -02:00
Don Wilson
c4d977fbbc
Added :negative_format option to number_to_currency function [ #5894 state:resolved]
...
Signed-off-by: Andrew White <andyw@pixeltrix.co.uk >
2010-11-02 23:00:23 +00:00
Santiago Pastorino
3c7215bdce
Test that capture doesn't escape twice
2010-11-02 20:02:55 -02:00
Jeff Kreeftmeijer
bb9c58eb4a
Make sure capture's output gets html_escaped [ #5545 state:resolved]
...
Also remove a duplicate test_link_to_unless assertion and add .html_safe to the
remaining one.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-11-02 19:38:28 -02:00
Andrew White
4ba24ba043
Allow generated url helpers to be overriden [ #5243 state:resolved]
2010-10-26 14:27:18 +01:00
Santiago Pastorino
ea7db8ebc1
number_to_phone always return safe
2010-10-17 20:42:13 -02:00
Stephen Celis
5e79094fc1
HTML5 data attribute helpers [ #5825 state:resolved].
2010-10-18 11:18:42 +13:00
André Camargo
c42ea2172e
Fix for ActionView::Template#refresh in rails 3.1.0.beta
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-10-15 08:39:10 +02:00
José Valim
01ab6f961b
Remove :cache => true on lookup templates initialization.
2010-10-14 09:47:49 +02:00
José Valim
37d78028b2
render :once should consider the current controller prefix.
2010-10-14 09:27:18 +02:00
Aditya Sanghi
582a088ba7
Fix test helpers to ensure get method forms are properly tested [ #5753 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-10-12 00:56:07 +02:00
Paco Guzman
31358d8c3c
data-disable-with in button_to helper
...
[#4993 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-10-11 13:24:07 -02:00
Santiago Pastorino
cb26eee54d
Revert "Make InstanceTagMethods#value_before_type_cast raise if the model don't respond to attr_before_type_cast or attr method"
...
And "Makes form_helper use overriden model accessors"
This reverts commit 3ba8e31005 and fb0bd8c109 .
2010-10-10 21:13:12 -02:00
José Valim
5ec27189b8
Do not allow templates coming from Fallback resolvers to store a virtual path.
2010-10-10 23:12:23 +02:00
José Valim
682368d4ba
Use identifiers for template equality.
2010-10-10 23:12:22 +02:00
José Valim
49b6f33f99
Clean up unused methods from AV::Base and pass in the template object on rendering.
2010-10-10 14:47:11 +02:00
José Valim
11aa515735
Add expire! and rerender to the template API. This will be used by SASS template handler.
2010-10-10 13:43:32 +02:00
José Valim
ffa32714bd
Add some unit tests to Template#refresh.
2010-10-10 13:17:04 +02:00
José Valim
38d78f99d5
Resolvers now consider timestamps.
...
Before this patch, every request in development caused the template
to be compiled, regardless if it was updated in the filesystem or not.
This patch now checks the timestamp and only compiles it again if
any change was done.
While this probably won't show any difference for current setups,
but it will be useful for asset template handlers (like SASS), as
compiling their templates is slower than ERb, Haml, etc.
2010-10-10 09:26:53 +02:00
José Valim
c7408a0e40
Deprecate old template handler API. Remove old handlers.
2010-10-10 01:14:50 +02:00
José Valim
64c7f7e392
Add more docs and tests to templates.
2010-10-09 23:56:08 +02:00
José Valim
54b09e17d4
Fix 1.9.2 failures.
2010-10-08 09:24:06 +02:00
Michael Koziarski
581b2b6836
fix rendering a partial with an array as its :object [ #5746 state:resolved]
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
Conflicts:
actionpack/lib/action_view/render/partials.rb
2010-10-08 11:12:11 +13:00