Commit Graph

8711 Commits

Author SHA1 Message Date
Łukasz Strzałkowski
c90971644a Revert "Rename abstract_controller/rendering. to errors.rb"
This reverts commit 6fe91ec5008838338e54ab8570f7c95ee0cdd8e8.
2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski
cad8a20187 Rename abstract_controller/rendering. to errors.rb
Since all rendering stuff was extracted to AV, the only thing that left was single class with error so file name wasn't relevant anymore
2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski
8c2c95e5d2 Fix AP test suite after moving stuff to AV 2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski
766fa97b45 Hook up AV::Rendering on AV intialization 2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski
c48ce6e73d Move layouts to AV 2013-08-25 11:39:07 +02:00
Łukasz Strzałkowski
5759531a95 Move rendering from AP to AV 2013-08-25 11:39:07 +02:00
Łukasz Strzałkowski
1b446d06dd Move view_paths from AP to AV 2013-08-25 11:39:07 +02:00
Kir Shatrov
a725a453b3 Display exceptions in text format for xhr request 2013-08-22 22:20:34 +04:00
Adrien Siami
7fd475273a Escape the message of an exception in debug_exceptions to avoid bad rendering 2013-08-21 15:51:03 +02:00
Santiago Pastorino
55360ddf7f Use each_with_object 2013-08-19 15:23:03 -03:00
Santiago Pastorino
e5945e4965 Organize normalize_encoding_params' conditionals a bit better and use a case statement for it
Refactor of the work done in #11891
2013-08-19 15:17:27 -03:00
Santiago Pastorino
ce2d837a5a Merge pull request #11891 from robertomiranda/remove_upload_module
Normalize file parameters in same place as other parameters (ActionDispatch::Http::Parameters#normalize_encode_params)
2013-08-19 11:11:36 -07:00
Santiago Pastorino
f97fdace54 Merge pull request #11443 from wangjohn/sse_reloader_class
SSE class for ActionController::Live
2013-08-19 07:30:27 -07:00
Ben Woosley
f84c6201dd Fail informatively in #respond_with when no appropriate #api_behavior renderer is available.
Currently if a user calls #respond_with(csvable), but has not csv
renderer available, Responder will just run through the default render
behavior twice, raising ActionView::MissingTemplate both times.

This changes ActionController::Metal::Responder#api_behavior to check
in advance whether there is a renderer available, and raise
ActionController::MissingRenderer if not.
2013-08-17 19:03:45 -07:00
Vijay Dev
9abe72c760 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	actionview/README.rdoc
	activerecord/lib/active_record/migration.rb
	guides/source/development_dependencies_install.md
	guides/source/getting_started.md
2013-08-17 21:49:16 +05:30
Vijay Dev
ec8ef1e105 Revert "Merge branch 'master' of github.com:rails/docrails"
This reverts commit 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing
changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9.

Seems to be a code merge done by mistake.
2013-08-17 21:46:39 +05:30
robertomiranda
5e6a8b9119 Normalize file parameters in same place as other parameters (ActionDispatch::Http::Parameters#normalize_encode_params) 2013-08-14 21:16:08 -05:00
Nicholas Jakobsen
55cbb85fb7 Execute conditional procs on controller filters only for current action.
:only and :except options for controller filters are now added before
:if and :unless. This prevents running :if and :unless procs when not
on the specified. Closes #11786.
2013-08-10 09:13:20 -07:00
Rahul P. Chaudhari
6a20cf4f05 Added data for permit array into scalar value 2013-08-05 19:10:54 +05:30
Ryan McGeary
51520a75d5 Pass assert_dom_equal message arg to underlying assertion
#assert_dom_equal and #assert_dom_not_equal both take a "failure"
message argument, but this argument was not utilized.
2013-08-04 11:18:46 -04:00
Rajeev N Bharshetty
65263c1b3c fix a gramatical mistake 2013-08-02 18:17:09 +05:30
Paul Nikitochkin
63ba124fa4 Improve documentation for controller how to get included helpers [ci skip]
Closes #11671
2013-07-30 22:52:48 +03:00
wangjohn
d2d6aef510 Creating an SSE class to be used with ActionController::Live. 2013-07-30 03:23:01 -04:00
Max Shytikov
310fc2b8c1 Refactor handling of action normalization
Reference:
Bloody mess internals
http://gusiev.com/slides/rails_contribution/static/#40
2013-07-26 09:49:07 +01:00
Ankit Gupta
c213bf174f Typo fix
[skip ci] Fixing the typo which is formed a not required link.  Check here http://api.rubyonrails.org/classes/ActionController/Base.html  under paramters section
keeping it under tt tag
2013-07-25 11:57:27 +01:00
Andrew White
4db0637d55 Allow overriding of all headers from passed environment hash
Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from
the environment passed into `ActionDispatch::TestRequest.new`.

Fixes #11590
2013-07-25 07:54:57 +01:00
Max Vasiliev
0d477e40a8 Removed random dot in code sample [ci skip] 2013-07-22 16:13:18 +04:00
Andrew White
e5275f9b59 Clear named routes when routes.rb is reloaded
Fix an issue where Journey was failing to clear the named routes hash when the
routes were reloaded and since it doesn't overwrite existing routes then if a
route changed but wasn't renamed it kept the old definition. This was being
masked by the optimised url helpers so it only became apparent when passing an
options hash to the url helper.
2013-07-21 17:11:52 +01:00
Andrew White
1a58ac60d9 Refactor to reduce number of loops
Only build the missing_keys array once we have detected that there
actually are missing keys by moving the check to be part of the block
that performs the path substitution.
2013-07-17 10:46:20 +01:00
Andrew White
74722d66d3 Fix failing test missed for the past year :(
When optimized path helpers were re-introduced in d7014bc the test added
in a328f2f broke but no-one noticed because it wasn't being run by the
test suite.

Fix the test by checking for nil values or empty strings after the args
have been parameterized.
2013-07-17 08:56:34 +01:00
Andrew White
1555a1800e Skip Rack applications and redirects when generating urls
When generating an unnamed url (i.e. using `url_for` with an options
hash) we should skip anything other than standard Rails routes otherwise
it will match the first mounted application or redirect and generate a
url with query parameters rather than raising an error if the options
hash doesn't match any defined routes.

Fixes #8018
2013-07-16 13:39:17 +01:00
Yves Senn
5bee14f3a4 move MissingHelperError out of the ClassMethods module. 2013-07-12 15:34:29 +02:00
Robin Dupret
b163754bc5 Add documentation for add_flash_types [ci skip]
Document a little bit the ActionController::Flash::add_flash_types
class method.
2013-07-10 20:55:05 +02:00
Piotr Niełacny
e0438b1c07 Show real LoadError on helpers require
When helper try to require missing file rails will throw exception about
missing helper.

  # app/helpers/my_helper.rb

  require 'missing'

  module MyHelper
  end

And when we try do load helper

  class ApplicationController
    helper :my
  end

Rails will throw exception. This is wrong because there is a helper
file.

  Missing helper file helpers/my_helper.rb

Now when helper try to require non-existed file rails will throw proper
exception.

  No such file to load -- missing
2013-07-10 11:26:43 +02:00
Rafael Mendonça França
ae85a4aa98 Merge pull request #11351 from jetthoughts/cleanup_request
Use content_length method instead of ENV['CONTENT_LENGTH'].to_i
2013-07-09 01:47:43 -07:00
Paul Nikitochkin
f6746c0245 Use Request#raw_post instead Request#body
In order to get raw_post to be not empty after
ParamsParser#parse_formatted_parameters,
added rewinding of body stream input on parsing json params.

Closes #11345
2013-07-08 01:48:35 +03:00
Paul Nikitochkin
c61b3ce0f5 Use helper method to get ENV['CONTENT_LENGTH'] 2013-07-08 00:11:57 +03:00
Yamagishi Kazutoshi
ce89251bb2 Space is not required for Set-Cookie header 2013-07-05 15:40:14 +09:00
Yves Senn
1bf5fc293d remove useless env.merge!(env) from ActionDispatch::IntegrationTest` 2013-07-04 12:11:53 +02:00
Edho Arief
1ba0a1f87a Missing closing + in documentation [ci skip] 2013-07-04 16:47:43 +09:00
Carlos Antonio da Silva
bf12c35087 Remove deprecated Rails application fallback for integration testing
Set ActionDispatch.test_app instead.
2013-07-02 22:59:59 -03:00
Carlos Antonio da Silva
b990921f05 Remove deprecated constants autoload
These constants were removed in 4b97ce5eb16cc20207516387fba98bf577e2e281,
but I forgot to remove the autoload calls .
2013-07-02 22:53:37 -03:00
Neeraj Singh
70568b4bbd use extract_options! 2013-07-02 22:46:31 +05:30
Francesco Rodriguez
fa45401b82 Remove page_cache_extension deprecated method 2013-07-01 22:09:11 -05:00
Carlos Antonio da Silva
4b97ce5eb1 Remove deprecated constants from Action Controller
ActionController::AbstractRequest  => ActionDispatch::Request
  ActionController::Request          => ActionDispatch::Request
  ActionController::AbstractResponse => ActionDispatch::Response
  ActionController::Response         => ActionDispatch::Response
  ActionController::Routing          => ActionDispatch::Routing
  ActionController::Integration      => ActionDispatch::Integration
  ActionController::IntegrationTest  => ActionDispatch::IntegrationTest
2013-07-01 22:20:23 -03:00
Charlie Somerville
5e356de271 store a symbol directly inside DISPATCH_CACHE for extra roflscale 2013-06-30 11:31:36 +10:00
Aaron Patterson
1b6aa27320 writing the new body can cause the response to be committed and the
request thread to return up the stack before the instance variable is
assigned.  Synchronize so that the ivar is assigned before the other
thread can activate.

fixes #10984
2013-06-28 16:51:53 -07:00
kennyj
db0499a6b6 Re-remove deprecated API. 2013-06-28 01:42:07 +09:00
Carlos Antonio da Silva
dd9d869746 Merge pull request #11000 from sbeckeriv/accept_header
Fix undefined method `ref' for nil:NilClass for bad accept headers
2013-06-25 19:34:20 -03:00
Andrew White
37b4276dbf Fix shorthand routes where controller and action are in the scope
Merge `:action` from routing scope and assign endpoint if both `:controller`
and `:action` are present. The endpoint assignment only occurs if there is
no `:to` present in the options hash so should only affect routes using the
shorthand syntax (i.e. endpoint is inferred from the the path).

Fixes #9856
2013-06-25 06:04:26 +01:00