Commit Graph

6750 Commits

Author SHA1 Message Date
Joshua Peek
ed24595647 Merge branch 'master' into sprockets 2011-04-12 21:56:00 -05:00
Xavier Noria
3366479a9a Merge branch 'master' of git://github.com/lifo/docrails 2011-04-12 22:45:33 +02:00
David Heinemeier Hansson
d1575ae1b9 Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion! 2011-04-12 00:23:07 +02:00
Oge Nnadi
d5634b2287 Added missing </tt> 2011-04-11 13:08:58 -07:00
Prem Sichanugrist
d6edaeeaf8 Fix failing test case on master
It turned out that I overlook at some replacements ..
2011-04-10 22:40:21 -07:00
Prem Sichanugrist
a9f3c9da01 Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
2011-04-11 03:17:09 +08:00
Jo Liss
c59456a1d9 removed :nodoc: from ActionController::MimeResponds
So we don't miss out on the nice documentation of the respond_to and
respond_with instance methods.  Also added :nodoc: to protected method.
2011-04-10 11:47:22 +02:00
James Robinson
2cdc1f0cd5 Make csrf_meta_tags use the tag helper
Improved formatting of csrf_helper and improved test coverage
2011-04-08 02:21:08 +02:00
Aaron Patterson
a7c5d40d80 Merge branch 'master' of github.com:rails/rails
* 'master' of github.com:rails/rails:
  Cache flash now
  Revert "Use freeze instead of close!"
  Revert "Eagerly load Signed and Permanent cookies"
  cookies here
  Eagerly load Signed and Permanent cookies
  Use freeze instead of close!
2011-04-07 09:35:24 -07:00
Santiago Pastorino
0e624ce9eb Cache flash now 2011-04-07 09:27:00 -03:00
Santiago Pastorino
03d561ad77 Revert "Use freeze instead of close!"
This reverts commit 29592a7f09dda2e7e1e0a915d9230fe6a9b5c0af.
2011-04-07 09:26:04 -03:00
Santiago Pastorino
5b0149a17a Revert "Eagerly load Signed and Permanent cookies"
This reverts commit dffeda377021ba8691381195f5a2889f8e040b93.
2011-04-07 09:20:56 -03:00
Santiago Pastorino
17205435f8 cookies here 2011-04-07 09:20:35 -03:00
Santiago Pastorino
dffeda3770 Eagerly load Signed and Permanent cookies 2011-04-07 09:15:28 -03:00
Aaron Patterson
1e90229e04 many args does not make sense with the current implementation because of how use works 2011-04-06 18:13:16 -07:00
Aaron Patterson
32f876786a getting the flash hash under test 2011-04-06 18:01:03 -07:00
Aaron Patterson
76c2ea7882 favor composition over inheritance, have FlashHash delegate to a Hash 2011-04-06 17:26:55 -07:00
Santiago Pastorino
29592a7f09 Use freeze instead of close! 2011-04-06 20:53:48 -03:00
Aaron Patterson
0ca69ca65f CookieJar should prefer composition over inheritance 2011-04-06 16:27:05 -07:00
Santiago Pastorino
9f765f4e09 Delete useless arguments 2011-04-06 19:18:41 -03:00
Santiago Pastorino
ed04243629 Delete useless env variable 2011-04-06 19:15:33 -03:00
Santiago Pastorino
0d45567362 Add tests to verify that signed and permanent cookies raises if someone tries
to modify the cookies when it was already streamed back to the client
or converted to HTTP headers
2011-04-06 19:12:35 -03:00
Santiago Pastorino
0e4748cd41 Make process reuse the env var passed as argument 2011-04-06 16:37:55 -03:00
Santiago Pastorino
0c5aded092 raise if someone tries to modify the cookies when it was already streamed back to the client or converted to HTTP headers 2011-04-06 15:47:58 -03:00
Santiago Pastorino
90ecad0bc9 Add ClosedError message to the initializer 2011-04-06 15:45:23 -03:00
Aaron Patterson
2e757bc298 do not return html safe strings from auto_link 2011-04-05 16:22:53 -07:00
Santiago Pastorino
d7a5638dfb raise if someone tries to modify the flash when it was already streamed back to the client or converted to HTTP headers 2011-04-05 10:41:34 -03:00
Ryan Bigg
92e6255b58 Merge branch 'master' of github.com:lifo/docrails
* 'master' of github.com:lifo/docrails: (57 commits)
  Made the defaults section a little more readable and more to the point, giving a overview of the possibilities.
  Added information about default values
  added .'s to headings in the initialization textile page
  s/ERb/ERB/g (part II)
  s/ERb/ERB/g
  Bump up erubis to 2.7.0
  Implicit actions named not_implemented can be rendered
  Gem::Specification#has_rdoc= is deprecated since rubygems 1.7.0
  default_executable is deprecated since rubygems 1.7.0
  Trivial fix to HTTP Digest auth MD5 example
  Moved Turn activation/dependency to railties
  fix typo
  Direct logging of Active Record to STDOUT so it's shown inline with the results in the console [DHH]
  Add using Turn with natural language test case names if the library is available (which it will be in Rails 3.1) [DHH]
  require turn only for minitest
  Use Turn to format all Rails tests and enable the natural language case names
  Improve docs.
  pass respond_with options to controller render when using a template for api navigation
  only try to display an api template in responders if the request is a get or there are no errors
  when using respond_with with an invalid resource and custom options, the default response status and error messages should be returned
  ...
2011-04-05 21:22:38 +10:00
Ryan Bigg
357578256f Correct documentation on url_for. It doesn't call to_s, but rather to_param 2011-04-05 21:22:10 +10:00
Xavier Noria
3e24e9ebc2 Merge branch 'master' of git://github.com/lifo/docrails 2011-04-03 22:22:03 +02:00
Akira Matsuda
9bf5cddd28 s/ERb/ERB/g (part II) 2011-04-03 16:59:37 +09:00
Akira Matsuda
bd3cdeea35 s/ERb/ERB/g
The author of ERB sais, his eRuby implementation was originally named "ERb/ERbLight" and then renamed to "ERB" when started bundled as a Ruby standard lib.
http://www2a.biglobe.ne.jp/~seki/ruby/erb.html
2011-04-03 12:47:51 +09:00
Santiago Pastorino
a000fc58b8 Bump up erubis to 2.7.0 2011-04-02 23:56:52 -03:00
Santiago Pastorino
cc58fe79ac Implicit actions named not_implemented can be rendered 2011-04-02 23:47:50 -03:00
Santiago Pastorino
99da42c299 Gem::Specification#has_rdoc= is deprecated since rubygems 1.7.0 2011-04-02 00:35:33 -03:00
Jon Cooper
c17b8e4047 Trivial fix to HTTP Digest auth MD5 example 2011-03-31 16:22:52 -07:00
José Valim
7a9dafd96c Improve docs. 2011-03-31 19:00:05 +02:00
Josh Kalderimis
b45302d767 pass respond_with options to controller render when using a template for api navigation
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-31 18:53:36 +02:00
Josh Kalderimis
48404a751d only try to display an api template in responders if the request is a get or there are no errors
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-31 18:53:27 +02:00
Josh Kalderimis
9766997f4c when using respond_with with an invalid resource and custom options, the default response status and error messages should be returned
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-31 18:53:21 +02:00
Amaia Castro
a64abdda25 Explain in the method doc that you need to call respond_to at the class level in order to use respond_with. 2011-03-31 13:19:19 +02:00
Joshua Peek
28fee29e38 Unify sprockets config options 2011-03-30 21:56:15 -05:00
Joshua Peek
56a5da89db Merge branch 'master' into sprockets
Conflicts:
	railties/lib/rails/application/configuration.rb
2011-03-30 21:04:33 -05:00
Joshua Peek
5df076ad09 Merge branch 'master' into sprockets 2011-03-30 20:56:05 -05:00
Aaron Patterson
58c3ec1b7b use assert_equal so we get normal error messages along with our custom failure message 2011-03-30 15:29:52 -07:00
José Valim
ba51aa0b1b Make action_method? public and change implicit rendering to override it instead. 2011-03-30 17:22:05 +02:00
Joshua Peek
77d8f7a4b7 Seperate asset directories 2011-03-29 21:40:24 -05:00
Joshua Peek
651d371a24 Rename option to config.asset_pipeline 2011-03-29 21:23:05 -05:00
Joshua Peek
db3e310d6b Change back to /assets prefix 2011-03-29 18:05:23 -05:00
Joshua Peek
a5f547cc79 Only add fingerprints if perform_caching is on 2011-03-29 17:27:49 -05:00
Joshua Peek
bed7a1acc4 Copy use_sprockets config 2011-03-29 16:17:49 -05:00
Joshua Peek
375443a9c5 Use sprockets helpers if config.use_sprockets is set 2011-03-29 15:53:28 -05:00
Joshua Peek
1af295fc9a Tests for SprocketsHelper 2011-03-29 15:42:31 -05:00
José Valim
94907035b6 Pass the proper method_name instead of hardcoding to action_name.
Conflicts:

	actionpack/lib/action_controller/metal/implicit_render.rb
2011-03-29 19:30:59 +02:00
David Heinemeier Hansson
e8d20b858d Dont call authenticate_or_request_with_http_basic twice 2011-03-29 07:29:10 -07:00
Sebastian Martinez
52351bcfeb Remove 'warning: ambiguous first argument' when running ActionPack tests
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-29 10:23:10 -03:00
Prem Sichanugrist
84a4ef63a4 Move mapper_test to the appropriate location
It seems like in 89c5b9aee7d7db95cec9e5a934c3761872ab107e Aaron actually put the test in action_dispatch folder. However, there's already a `test/dispatch` directory which I think it's more appropriate.

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-03-29 10:12:17 +01:00
Prem Sichanugrist
51551a0a5b Update the wildcard route to be non-greedy by default, therefore be able to match the (.:format) segment [#6605 state:resolved]
After some discussion with Andrew White, it seems like this is a better approach for handling a wildcard route. However, user can still bring back the old behavior by supplying `:format => false` to the route.

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-03-29 10:12:17 +01:00
John Firebaugh
07054fe369 Fix grammar, formatting, and cross references 2011-03-28 22:17:20 -07:00
Gabriel Horner
cc446d6c9f Add docs for ActionController::Metal class methods 2011-03-28 23:48:45 -04:00
David Heinemeier Hansson
3d1e7c2645 Fix examples 2011-03-28 18:15:41 -07:00
David Heinemeier Hansson
e2b07ee000 Added Base.http_basic_authenticate_with to do simple http basic authentication with a single class method call [DHH] 2011-03-28 18:10:08 -07:00
Joshua Peek
3b4e1a9159 Update sprockets path generation method 2011-03-28 15:58:29 -05:00
Joshua Peek
9cb264555d Add SprocketsHelper 2011-03-28 15:19:34 -05:00
Joshua Peek
41cc643065 Remove sprockets exception from main asset helpers 2011-03-28 13:54:58 -05:00
Xavier Noria
eea6a65488 Merge branch 'master' of git://github.com/lifo/docrails 2011-03-27 23:50:39 +02:00
Prem Sichanugrist
7cbdfa8303 Add controller-specific force_ssl method to force web browser to use HTTPS protocol
This would become useful for site which sometime transferring sensitive information such as account information on particular controller or action.

This featured was requested by DHH.
2011-03-28 04:58:47 +08:00
Xavier Noria
b2d94322e6 fixes a couple of regexps, the suite showed warnings about them
A couple of things worth mentioning here:

 - "{" is a metacharacter, should be escaped
   if it is meant to match a "{". The code
   worked, though, because the regexp engine
   is tolerant to this, but issued warnings.

 - gsub accepts a string as first argument.
   That's the best idiom to use when your
   pattern has no metacharacters, since gsub
   interprets the string as an exact substring
   to look for, rather than a regexp. The
   benefit is that your pattern is crystal
   clear and needs no backslashes.
2011-03-27 20:45:23 +02:00
David Heinemeier Hansson
cc6fa2f4d7 Fix alias_method, add test 2011-03-27 11:20:54 -07:00
David Heinemeier Hansson
f8a05ad297 Allow FormHelper#form_for to specify the :method as a direct option instead of through the :html hash [DHH] 2011-03-26 14:45:00 -07:00
David Heinemeier Hansson
cb3e96a447 Make JavaScriptHelper#j() an alias for JavaScriptHelper#escape_javascript() -- note this then supersedes the Object#j() method that the JSON gem adds within templates using the JavaScriptHelper [DHH] 2011-03-26 10:28:39 -07:00
Ryan Bigg
198f3883fa Proc objects for cache_path for caches_action no longer need controller object, nor to use send when calling routing helpers 2011-03-26 11:34:05 +11:00
Josh Kalderimis
5170d210e8 correction to the outputted controller name in the diagnostics error template, test included
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-24 19:43:48 -03:00
Andrew White
9772de8d45 Fix filter :only and :except with implicit actions
The method_name argument is "default_render" for implicit actions
so use the action_name attribute to determine which callbacks to run.

[#5673 state:resolved]
2011-03-23 23:32:44 +00:00
Manfred Stienstra
5da9a74bd3 Add a failing test case for an implicit action with a before filter.
Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-03-23 23:32:44 +00:00
Xavier Noria
3b91b3726d Merge branch 'master' of git://github.com/lifo/docrails 2011-03-23 21:52:33 +01:00
Joshua Peek
628c31b353 Add sprockets md5s to asset tags 2011-03-22 15:43:40 -05:00
Prem Sichanugrist
2ddfdba9a0 Do not show optional (.:format) block for wildcard route [#6605 state:resolved]
This will make the output of `rake routes` to be correctly match to the behavior of the application, as the regular expression used to match the path is greedy and won't capture the format part by default
2011-03-22 09:19:40 -07:00
Aaron Patterson
55bf087da1 SJIS is an alias to Windows-31J in ruby trunk. Use SHIFT_JIS for this test 2011-03-21 10:00:30 -07:00
José Valim
1413c9b1d5 Improved resolver docs a bit 2011-03-19 16:06:50 -07:00
Chris Kowalik
d76fadbd7d [action_view] docs for FileSystemResolver 2011-03-20 07:01:47 +08:00
Chris Kowalik
de1fe5e8a7 [action_view] added custom patterns to template resolver 2011-03-20 07:01:46 +08:00
Josh Kalderimis
0eae625256 fixes an issue with number_to_human when converting values which are less than 1 but greater than -1 [#6576 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-16 15:11:00 -03:00
Gabriel Horner
61781d84c1 doc :anchor option for #match in routes 2011-03-15 09:23:17 -04:00
Aaron Patterson
9f2706d770 use a list to represent the supported verbs for a route object 2011-03-14 18:26:30 -07:00
Aaron Patterson
9ba2d422f5 stop splatting arguments so that we can understand wtf is going on 2011-03-14 16:17:05 -07:00
Aaron Patterson
833a90594e RegexpWithNamedGroups is only used for path_info, so only apply to path info 2011-03-14 15:17:29 -07:00
Xavier Noria
21b12d89a6 Merge branch 'master' of git://github.com/lifo/docrails 2011-03-14 22:09:52 +01:00
Manuel Meurer
deae670e9a Change ActionView::ViewPathSet to ActionView::PathSet 2011-03-13 15:14:51 +07:00
Mike Gehard
58de03f077 Add additional text to NotImplementedErrors [#6328 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-12 13:43:23 -02:00
Aaron Patterson
acd4bfb537 Just define methods directly on the class rather than use the module
indirection.

clever--
2011-03-11 18:16:47 -08:00
Aaron Patterson
89c5b9aee7 do not automatically add format to routes that end in a slash 2011-03-11 18:06:22 -08:00
Prem Sichanugrist & Xavier Noria
68802d0fbe Filter sensitive query string parameters in the log [#6244 state:committed]
This provides more safety to applications that put secret information in the query string, such as API keys or SSO tokens.

Signed-off-by: Xavier Noria <fxn@hashref.com>
2011-03-11 00:16:18 +01:00
Andrew White
03cbd9672c Filter params that return nil for to_param and allow through false values 2011-03-09 14:44:25 +00:00
Aaron Patterson
0c777bace2 stop being clever and just call methods on the Route object 2011-03-08 16:18:27 -08:00
Aaron Patterson
f975626dc1 test/unit in ruby trunk adds a new instance variable. YAY! 2011-03-08 14:09:44 -08:00
Akira Matsuda
071ddb8281 more "SSL everywhere" for GitHub URLs
see: https://github.com/blog/738-sidejack-prevention-phase-2-ssl-everywhere
2011-03-07 06:18:32 +09:00
Akira Matsuda
5bed37779a "SSL everywhere" for GitHub URLs
see: https://github.com/blog/738-sidejack-prevention-phase-2-ssl-everywhere
2011-03-07 05:56:02 +09:00
Akira Matsuda
d91be36598 fix typos 2011-03-07 05:21:25 +09:00
Andrew White
31f09f9dbc Improve testing of cookies in functional tests:
- cookies can be set using string or symbol keys
- cookies are preserved across calls to get, post, etc.
- cookie names and values are escaped
- cookies can be cleared using @request.cookies.clear

[#6272 state:resolved]
2011-03-06 12:49:44 +00:00