Commit Graph

652 Commits

Author SHA1 Message Date
Rafael Mendonça França
5d54fd77b8 Add missing require.
I was trying to use those files without Rails and that require was
missing.
2012-12-13 14:49:58 -03:00
Carlos Antonio da Silva
0262a18c7b Bring back helpers_path attr accessor
This is apparently used by the railtie to setup the app helpers paths
correctly between initializers. I'll need to check it further.
2012-12-13 09:41:09 -02:00
Carlos Antonio da Silva
cff0e51ae9 Refactor helpers code in Action Pack a bit
* Avoid calling class_eval when not needed
* Remove helpers_path attr accessor, it's defined as a class attribute a
  few lines later
* Avoid creating extra arrays when finding helpers, use flat_map and sort!
* Remove not required refer variable when redirecting :back
2012-12-13 08:46:12 -02:00
Carlos Antonio da Silva
2125a6a27f Remove not used variable warnings from AM and AC 2012-12-11 23:57:56 -02:00
Francesco Rodriguez
5fb94ec044 use _action instead of _filter callbacks 2012-12-07 15:24:56 -05:00
Francesco Rodriguez
a53a7bea80 update documentation and code to use _action callbacks 2012-12-07 14:46:06 -05:00
Andrew White
e905639af2 Merge pull request #8404 from freegenie/filter_redirects 2012-12-05 02:21:44 -08:00
Fabrizio Regini
86e3aaab93 Adding filter capability to ActionController logs 2012-12-05 11:07:14 +01:00
claudiob
019df98875 Replace comments' non-breaking spaces with spaces
Sometimes, on Mac OS X, programmers accidentally press Option+Space
rather than just Space and don’t see the difference. The problem is
that Option+Space writes a non-breaking space (0XA0) rather than a
normal space (0x20).

This commit removes all the non-breaking spaces inadvertently
introduced in the comments of the code.
2012-12-04 22:11:54 -08:00
Alvaro Pereyra
4940d6d096 Cleans and removes useless 'Examples' tag [ci skip] 2012-12-01 15:19:45 -05:00
Florent Guilleux
8dc4041a9b Revert "Remove trailing whitespaces"
This reverts commit 90c887fa7d0c454b7533e208daefc342dea4d5f3.
2012-12-01 13:22:49 -05:00
Florent Guilleux
90c887fa7d Remove trailing whitespaces 2012-12-01 13:20:39 -05:00
Francesco Rodriguez
83482256ef hash filters should be accessed with symbols or strings 2012-11-30 11:24:16 -05:00
Uģis Ozols
9fb4803016 Fix Strong Parameters docs.
It's only possible to inherit from ActiveRecord::Base and not include
it.
2012-11-27 15:11:30 +02:00
Rafael Mendonça França
80b8df5f3d Remove warning of circular require
This file was using mime_types before load the Mime::Type class.
When trying to register first Mime::Type it load mime_type that loads
mime_types in the end.

Requiring mime_type ensure that we have the class definition and the
mime types
2012-11-27 02:37:24 -02:00
Elia Schito
5d8faa683e Accept symbols as #send_data :disposition value 2012-11-27 00:21:12 +01:00
Santiago Pastorino
ef8b845de7 Merge pull request #8112 from rails/encrypted_cookies
Encrypted cookies
2012-11-15 12:17:25 -08:00
Aaron Patterson
e5248aacd0 lazily calculate name in the options object 2012-11-13 16:35:16 -08:00
Aaron Patterson
2a51d6c3bb move include calculation to include method on the options object 2012-11-13 16:35:16 -08:00
Aaron Patterson
46284a183e model name is lazily evaluated in the options object 2012-11-13 16:35:16 -08:00
Aaron Patterson
d7c7270600 move the controller class to the options object 2012-11-13 16:35:15 -08:00
Aaron Patterson
4729208f6a attribute_names will always return a list, so just use any? 2012-11-13 16:35:15 -08:00
Aaron Patterson
df3b650810 wrap up hash conversion in the constructor 2012-11-13 16:35:15 -08:00
Aaron Patterson
fc29bff445 use the options object in the wrapper defaults 2012-11-13 16:35:15 -08:00
Aaron Patterson
95ec448580 start using options object 2012-11-13 16:35:15 -08:00
Aaron Patterson
bf3546549b only do hash lookups on options once 2012-11-13 16:35:15 -08:00
Aaron Patterson
9a64ffc0c7 replace present? with any? to reduce dependency on AS 2012-11-13 16:35:15 -08:00
Benjamin Quorning
3443649904 Set @permitted on new instance when slicing parameters hash 2012-11-06 21:32:03 +01:00
Carlos Antonio da Silva
51b901408e Remove #permitted attr accessor from Parameters
There is no need to expose this accessor since we already have the query
method #permitted? that should handle this purpose.
2012-11-03 16:57:19 -02:00
Santiago Pastorino
47da574474 Allow users to change the default salt if they want, shouldn't be necessary 2012-11-03 14:57:54 -02:00
Santiago Pastorino
5d23925f84 Use derived keys everywhere, http_authentication was missing it 2012-11-03 14:57:54 -02:00
Santiago Pastorino
60609bb50d Sign cookies using key deriver 2012-11-03 14:57:53 -02:00
Vijay Dev
3b0bb08699 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_controller/metal/mime_responds.rb
	activerecord/lib/active_record/attribute_methods.rb
	guides/source/working_with_javascript_in_rails.md
2012-11-03 01:56:16 +05:30
Vijay Dev
8ffb0dacf9 Revert "dont encourage AC::Parameters#permit_all_parameters usage [ci skip]"
This reverts commit cd17ee5598411728747011566abf6779166be9d3.

Reason: Let's note that this is discouraged, not remove the docs

[ci skip]
2012-11-03 01:16:57 +05:30
David Heinemeier Hansson
954c350daf Allow #permit to take its list of permitted parameters as an array 2012-10-31 16:33:54 +01:00
Francesco Rodriguez
cd17ee5598 dont encourage AC::Parameters#permit_all_parameters usage [ci skip] 2012-10-28 17:51:28 -05:00
AvnerCohen
62f273b650 Multiple changes to 1,9 hash syntax 2012-10-27 22:05:27 +02:00
Yves Senn
4d7f53379a cleanup, remove trailing whitespace within actionpack 2012-10-27 16:03:18 +02:00
Aaron Patterson
59a53f4525 remain backwards compatible, exception can be constructed with no arguments 2012-10-25 13:51:30 -07:00
Aaron Patterson
cde326bcef give access to the original exception raised in case of a parse error 2012-10-25 11:34:37 -07:00
Francesco Rodriguez
ae057d622f fix StrongParameters example [ci skip] 2012-10-21 11:49:51 -05:00
Vijay Dev
f938019da2 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activesupport/lib/active_support/core_ext/hash/slice.rb
	guides/source/active_support_core_extensions.md
2012-10-21 18:49:19 +05:30
thedarkone
7cc5bf51b4 There is already a Set of non-hidden action_names lying around. 2012-10-18 16:17:08 -07:00
Francesco Rodriguez
2834454de7 add a nested attributes example into Strong Parameters documentation [ci skip] 2012-10-18 12:44:28 -05:00
Francesco Rodriguez
f069ec162f remove some non-breaking spaces [ci skip] 2012-10-18 01:38:36 -05:00
Rafael Mendonça França
0c3ca0f013 Permit string and float values in the multiparameter attributes 2012-10-18 00:31:46 -03:00
Arun Agrawal
11f01bee65 warning removed: shadowing outer local variable - value 2012-10-12 18:53:15 +05:30
Francesco Rodriguez
299fee5919 update AC::Parameters#permit documentation [ci skip]
bdd105d changes the behaviour of AC::Parameters#permit.
2012-10-11 22:41:01 -05:00
Santiago Pastorino
bdd105d8b9 When executing permit with just a key that points to a hash, DO NOT allow all the hash
params.require(:person).permit(:projects_attributes) was returning
=> {"projects_attributes"=>{"0"=>{"name"=>"Project 1"}}}

When should return
=> {}

You should be doing ...
params.require(:person).permit(projects_attributes: :name)
to get just the projects attributes you want to allow
2012-10-12 01:01:26 -02:00
Rafael Mendonça França
14b66d6628 We don't need the each call since grep take a block and yield each match
to the block.

Thanks @tenderlove
2012-10-06 02:07:36 -03:00