Commit Graph

3715 Commits

Author SHA1 Message Date
José Valim 43d27e9105 Deprecate passing the template handler in the template name.
For example, calling hello.erb is now deprecated. Since Rails 3.0
passing the handler had no effect whatsover. This commit simply
deprecates such cases so we can clean up the code in later releases.
2011-09-22 15:37:38 +02:00
José Valim 119e9e2daf Get rid of update_details in favor of passing details to find_template. 2011-09-22 15:03:05 +02:00
Nick Sutterer cbaad674f1 it is now possible to pass details options (:formats, :details, :locales, ...) to #render, #find_template and friends. this doesn't change anything in global context. 2011-09-22 14:12:36 +02:00
Pawel Pierzchala 019eea4a38 Fix named routes modifying arguments 2011-09-22 09:57:00 +02:00
Santiago Pastorino da7f0426ec Allow asset tag helper methods to accept :digest => false option in order to completely avoid the digest generation. 2011-09-14 15:02:17 -07:00
Santiago Pastorino 5f28c22722 Merge pull request #2964 from msgehard/silence_warnings
Silence Ruby warnings about uninitialized instance variable.
2011-09-14 00:27:45 -07:00
Santiago Pastorino b0cee70354 Merge pull request #2977 from guilleiguaran/fix-relative-root-in-assets
Set relative url root in assets when controller isn't available for Sprockets
2011-09-12 23:25:28 -07:00
Guillermo Iguaran 9279d1102c Set relative url root in assets when controller isn't available for Sprockets. Fix #2435
See https://github.com/rails/sass-rails/issues/42 for details
2011-09-13 01:02:44 -05:00
Aaron Patterson a08bee7841 all routes can be stored in the Journey Routes object 2011-09-12 16:50:48 -07:00
Santiago Pastorino a9509284ca Merge pull request #2974 from md5/csrf_token_warning
Use ensure instead of rescue
2011-09-10 17:29:04 -07:00
Mike Dillon dbef311819 Use ensure instead of rescue 2011-09-10 11:01:22 -07:00
Aaron Patterson d0946fdd57 Merge pull request #2972 from md5/master
Use log.warn instead of debug for CSRF token warning
2011-09-10 10:45:47 -07:00
Mike Dillon 538fb18dea Add test for warning and CHANGELOG entry 2011-09-10 09:51:55 -07:00
Arun Agrawal abbd27fad8 No need to use </form> here. It's already in whole_form block 2011-09-10 12:22:29 +05:30
Mike Gehard 6c43532cb6 Silence Ruby warnings about uninitialized instance variable. 2011-09-09 15:48:43 -06:00
Aaron Patterson ac1a363c6e Pull up a method we only use once. 2011-09-08 16:04:57 -07:00
Aaron Patterson 41a085ebc9 Conditions must never be equal 2011-09-08 16:04:57 -07:00
Jon Leighton 16f1ce41d5 Merge pull request #2499 from akaspick/assert_select_email_fix
Fix assert_select_email to work on non-multipart emails as well as converting the Mail::Body to a string to prevent errors.
2011-09-07 05:51:31 -07:00
Aaron Patterson f6ced69a11 Eliminate newlines in basic auth. fixes #2882 2011-09-06 17:25:20 -07:00
Santiago Pastorino a23e3855c5 Merge pull request #2872 from sikachu/content_tag_html_safe
Make sure that result from content_tag_for with collection is html_safe
2011-09-05 07:08:39 -07:00
Santiago Pastorino f4a690dae7 Merge pull request #2815 from avakhov/current-page-non-get-requests
current_page? returns false for non-GET requests
2011-09-05 06:13:14 -07:00
Santiago Pastorino c255e0eed5 Merge pull request #2799 from tomstuart/3-1-stable
Never return stored content from content_for when a block is given
2011-09-05 10:11:43 -03:00
Prem Sichanugrist ffe56f3b8c Make sure that result from content_tag_for with collection is html_safe
Thank you @spastorino for catching the empty test in b84cee0, as I totally forgot that I still have to make it html_safe.
2011-09-05 20:04:37 +07:00
Vijay Dev 24ee573d6c add blanks between methods 2011-09-05 13:41:25 +05:30
Santiago Pastorino 4f8777333d Remove empty test 2011-09-05 00:43:51 -03:00
Santiago Pastorino 8bffd6c6ae Merge pull request #2863 from raybaxter/silence_unitialized_instance_variable_warnings
Silence unitialized instance variable warnings
2011-09-04 20:37:02 -07:00
Ray Baxter fa0ebf4c98 Tests shouldn't produce warnings 2011-09-04 20:27:53 -07:00
Santiago Pastorino a1fa756e17 * is not allowed in windows file names. Closes #2574 #2847 2011-09-04 17:44:48 -03:00
Prem Sichanugrist b84cee08c6 Make `content_tag_for` and `div_for` accepts the array of records
So instead of having to do this:

   @items.each do |item|
     content_tag_for(:li, item) do
        Title: <%= item.title %>
     end
   end

You can now do this:

   content_tag_for(:li, @items) do |item|
     Title: <%= item.title %>
   end
2011-09-04 11:55:12 +07:00
Alexey Vakhov fddf7ea1c1 current_page? returns false for non-GET requests 2011-09-02 18:20:10 +04:00
Aaron Patterson fdd619e9a7 CookieJar is enumerable. fixes #2795 2011-09-01 13:37:14 -07:00
Guillermo Iguaran f236e00189 Backport f443f9cb0c to master 2011-08-31 13:12:09 -05:00
Santiago Pastorino e5f2b0d75f Revert "Merge pull request #2647 from dmathieu/no_rescue"
This reverts commit 125b1b0b91.
2011-08-30 20:52:08 -03:00
Arun Agrawal 651ef614f1 Removed Unused Variable. 2011-08-26 11:29:05 +05:30
Santiago Pastorino 67274ca162 Merge pull request #2491 from waynn/fix_symbol
fix destructive stringify_keys for label_tag
2011-08-25 07:39:31 -07:00
Santiago Pastorino 976b2be108 Merge pull request #2644 from guilleiguaran/allow-assets-debugging
Add config.allow_debugging option
2011-08-24 08:01:08 -07:00
Guillermo Iguaran 827cdae6fb Add config.allow_debugging option to determine if the debug_assets query param can be passed by user 2011-08-24 09:53:55 -05:00
Santiago Pastorino 23d8a980d2 Merge pull request #2668 from guilleiguaran/debug-assets-media-type
Debug assets shouldn't ignore media type for stylesheets. Closes #2625
2011-08-24 07:46:04 -07:00
Santiago Pastorino f162f84aa5 Merge pull request #2647 from dmathieu/no_rescue
remove useless rescue
2011-08-24 07:02:03 -07:00
Damien Mathieu 13dd7758ce remove useless rescue
params is a method, defined in every controller, which always returns a hash.
If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about.
2011-08-24 09:52:00 +02:00
Guillermo Iguaran d133fd6d29 Debug assets shouldn't ignore media type for stylesheets. Closes #2625 2011-08-23 21:36:21 -05:00
Andrew White ebea387e4b Add failing test case for #2654 2011-08-23 15:33:59 +01:00
Andrew White 13400ac289 Ensure regexp and hash key are UTF-8 2011-08-23 14:56:04 +01:00
Andrew White 14cf4b2e35 Don't modify params in place - fixes #2624 2011-08-23 11:07:37 +01:00
Santiago Pastorino 0b6da0c654 Merge pull request #2411 from ai/debug_assets_by_config
Debug assets by config
2011-08-22 11:50:27 -07:00
Andrey A.I. Sitnik 18b2223b32 Allow to debug assets by config.assets.debug 2011-08-22 09:36:36 +11:00
Teng Siong Ong f6ceb944ea fix escape_javascript for unicode character \u2028. 2011-08-21 15:14:45 -05:00
Guillermo Iguaran 7223f10acd Debug assets by default in development and test environments 2011-08-18 15:35:41 -05:00
Aaron Patterson 5f94b93279 Properly escape glob characters. 2011-08-16 15:28:27 -07:00
Aaron Patterson 586a944ddd Tags with invalid names should also be stripped in order to prevent
XSS attacks.  Thanks Sascha Depold for the report.
2011-08-16 15:24:48 -07:00
Jon Leighton 8e23615245 Use lazy load hooks to set parameter wrapping configuration. This means that it doesn't force Action Controller / Active Record to load, but it doesn't fail if they have already loaded. Thanks @josevalim for the hint. 2011-08-16 19:14:20 +01:00
Jon Leighton 6c5f67cac1 Don't refer to ActionController::Base in the wrap_parameters initializer - use config object instead. Cuts about 15% off the load time. (#734) 2011-08-16 00:59:59 +01:00
Arun Agrawal 45ccd64866 Unused variable removed. 2011-08-15 21:49:12 +05:30
Franck Verrot 75dd33a0ae Methods like status and location are interfering with redirect_to [Closes #2511] 2011-08-14 19:00:30 +02:00
Aaron Patterson 943a37348a moving test_generate to an integration test with one assert per test 2011-08-12 15:55:00 -07:00
Andrew Kaspick 60d358b233 fix assert_select_email to work on non-multipart emails as well as converting the Mail::Body to a string to prevent errors. 2011-08-11 17:49:31 -05:00
Andrew Kaspick 61579b7661 when calling url_for with a hash, additional (likely unwanted) values (such as :host) would be returned in the hash... calling #dup on the hash prevents this 2011-08-11 13:28:31 -05:00
Waynn Lue 895d64531d fix destructive stringify_keys for label_tag 2011-08-11 00:30:45 -07:00
Aaron Patterson f9f423fa18 deprecating process_view_paths 2011-08-09 12:10:25 -07:00
Ilya Grigorik ed5c6d254c generate environment dependent asset digests
If two different environments are configured to use the pipeline, but
one has an extra step (such as compression) then without taking the
environment into account you may end up serving wrong assets
2011-08-04 23:53:32 -04:00
Santiago Pastorino d7e55c3429 Merge pull request #2421 from pivotal-casebook/master
Simple_format should not edit it in place. (Fixes https://github.com/rails/rails/issues/1980)
2011-08-04 11:49:43 -07:00
Casebook Developer f0034c75d5 ActionView::Helpers::TextHelper#simple_format should not change the text in place. Now it duplicates it. 2011-08-04 13:34:47 -04:00
Santiago Pastorino cf96649bb7 Merge pull request #2356 from waynn/fix_symbol
fix stringify_keys destructive behavior for most FormTagHelper functions
2011-08-04 09:29:18 -07:00
Waynn Lue 54b83566cc fix stringify_keys destructive behavior for most FormTagHelper functions
add four new tests to verify that the other three methods that called stringify_keys! are fixed. verified that the tests break in master without the code patch. Closes #2355
2011-08-03 20:53:55 -07:00
thoefer 860202e8b2 Fix the issue where default_url_options is being cached on test cases. Closes #1872. Closes #2031.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-08-01 11:49:24 +02:00
José Valim dc8773b19f Rename new method to_path to to_partial_path to avoid conflicts with File#to_path and similar. 2011-08-01 11:42:00 +02:00
Santiago Pastorino d701b3fa47 Merge pull request #2379 from arunagw/extra_require_removal
Removing extra requires from the test. Already loaded in abstract_unit.
2011-07-31 11:50:52 -07:00
Arun Agrawal ec7457ed2a Removing extra requires from the test. Already loaded in abstract_unit. 2011-07-31 23:36:21 +05:30
Vishnu Atrai 070513016f remove extra require for 'active_support/dependencies' as it is required in abstract_unit.rb 2011-07-31 23:12:28 +05:30
Brian Cardarella 1c94ba0332 Instead of removing the instance variable just set it to nil, resolves the warnings because of a missing instance variable 2011-07-29 12:08:35 -04:00
José Valim b295ea1362 Merge pull request #2330 from thedarkone/resources-router-fix
Inline resources router fix
2011-07-28 11:10:23 -07:00
thedarkone 4d4d2179f6 There is no need to be destructive with the passed-in options.
This fixes a bug that is caused by Resource/SingletonResource mangling resource options when using inline "multi"-resource declarations.
2011-07-28 20:00:48 +02:00
José Valim 1b7db58a06 Merge pull request #2034 from Casecommons/to_path
Allow ActiveModel-compatible instances to define their own partial paths
2011-07-28 00:50:07 -07:00
Aaron Patterson ba43b9bf5f fixing wildcard path matching when wildcard is inside parenthesis 2011-07-26 17:33:22 -07:00
Aaron Patterson ef89a70540 Merge pull request #2095 from dgeb/issue-2094
Fixes overriding of options[:html][:remote] in form_for() (Issue #2094)
2011-07-26 13:50:20 -07:00
Damien Mathieu 945f0c82af use sprocket's append_path and assert_match 2011-07-26 16:59:15 +02:00
Grant Hutchins & Peter Jaros bf812074fd Let ActiveModel instances define partial paths.
Deprecate ActiveModel::Name#partial_path. Now you
should call #to_path directly on ActiveModel
instances.
2011-07-25 16:05:24 -04:00
Erik Michaels-Ober b9c9142603 Allow a route to have :format => true
When format is true, it is mandatory (as opposed to :format => false).
This is currently not possible with resource routes, which automatically
make format optional by default.
2011-07-25 11:37:25 -07:00
Santiago Pastorino 8e0061128e Merge pull request #2245 from davidtrogers/constraints_block_passed_to_following_routes_in_same_scope
Memoizing @blocks & disposing of constraints options properly
2011-07-25 10:32:31 -07:00
Dave Rogers 4dc42f5353 Ensure the constraints block is only applied to the correct route
addresses issue #1907 - any routes that follow a route with a constraints
  block are inheriting the previous route's constraints.
2011-07-25 09:59:53 -07:00
Aaron Patterson 36fd3fdf46 no need for an anonymous class on every setup call 2011-07-25 09:07:46 -07:00
José Valim b033a24814 Merge pull request #2258 from thedarkone/no-file-stat
Use shorter class-level File methods instead of going through File.stat
2011-07-25 08:13:21 -07:00
thedarkone 624b118616 Use shorter class-level File methods instead of going through File.stat. 2011-07-25 17:02:28 +02:00
thedarkone 036f77574d Make polymorphic_url calls go through application helpers again.
This brings back the ability to overwrite/extend url generating methods in application heleprs.
2011-07-25 13:43:02 +02:00
Xavier Noria 4bb0a8bcbd Merge branch 'master' of git://github.com/lifo/docrails 2011-07-24 21:02:51 +02:00
Oemuer Oezkir 71d18ce48e Changed a few instances of of words in the API docs written in British English to
American English(according to Weber)
2011-07-24 10:21:42 +00:00
Aaron Patterson d33eb07543 Merge pull request #2233 from gramos/fix-issue-1951-master
Fix issue 1951 master Namespaced model partial_path is wrong in namespaced controllers
2011-07-23 21:00:11 -07:00
Aaron Patterson d89a33d162 just use normal ruby for stubbing 2011-07-23 20:55:29 -07:00
Gaston Ramos dc1b0fd957 - added ActionView::PartialRenderer#merge_path_into_partial(path, partial)
fix issues/1951
2011-07-24 00:54:58 -03:00
Gaston Ramos 7621d131d2 - added test case for issue:
https://github.com/rails/rails/issues/1951
  Namespaced model partial_path is wrong in namespaced controllers
2011-07-24 00:54:45 -03:00
Ben Woosley 1f89898175 Simple fix to the NoMethodError noted in #2177.
Unfortunately #respond_to?(:controller) won't work as suggested, nor will respond_to?(:params), as #controller is present and #params is delegated to #controller. #delegate makes respond_to? return true regardless whether the target responds to it.
2011-07-23 17:31:48 -07:00
ogeidix 1ac802fe3c Check Accept and Content-Type headers before evaluating them in xhr requests. Closes #2119
An xhr request must have an "Accept" or "Content-type" header in order to be considered a request with valid_accept_header.
2011-07-19 22:05:16 +02:00
Jesse Storimer ac81af40c0 Ensure that status codes are logged properly
Needed to move AC::Metal::Instrumentation before AM::Metal::Rescue
so that status codes rendered from rescue_from blocks are logged
properly.
2011-07-18 13:42:07 -04:00
Santiago Pastorino e9bd83402e Merge pull request #2046 from sikachu/master-test_fix
Fix a wrong assertion on url_helper_test, and add missing `#html_safe?` a
2011-07-17 12:48:49 -07:00
Prem Sichanugrist edfb81d668 Fix a wrong assertion on url_helper_test, and refactor `html_safe` test to be in its method 2011-07-17 15:34:01 -04:00
Santiago Pastorino 7669c33c74 Merge pull request #2018 from bhus/render_partial_invalid_check
Render partial invalid check
2011-07-17 12:28:03 -07:00
Dan Gebhardt 455e321284 added test case for fix to issue #2094 2011-07-16 08:22:43 -04:00
Bradford Folkens 4755930727 assert nothing raised for setting a cookie value to nil in ActionDispatch 2011-07-14 14:01:39 -05:00
huskins 2668dce1c0 Added view template invalid name check, along with tests. No merges in commit. 2011-07-13 13:06:03 -04:00
Joseph Wong 66dee26930 Fixed session ID fixation for ActiveRecord::SessionStore
I have found that Rails will take an invalid session ID specified by the
client and materialize a session based on that session ID. This means
that it is possible, among other things, for a client to use an
arbitrarily weak session ID or for a client to resurrect a previous used
session ID. In other words, we cannot guarantee that all session IDs are
generated by the server and that they are (statistically) unique through
time.

The fix is to always generate a new session ID in #get_session if an
existing session cannot be found under the incoming session ID.

Also added new tests that make sure that an invalid session ID is never
materialized into a new session, regardless of whether it comes in via a
cookie or a URL parameter (when :cookie_only => false).
2011-07-12 11:09:11 -07:00