Commit Graph

1213 Commits

Author SHA1 Message Date
Prakash Laxkar 0c5c88243b Add test cases for checkbox_tag 2015-10-01 08:43:14 +05:30
Akshay Vishnoi c293eca83f Add test case for text_field_tag 2015-10-01 00:28:52 +05:30
Prakash Laxkar 62b74d2b60 Improve readability of docs by using code tag [ci skip] 2015-09-29 14:44:17 +05:30
Rafael Mendonça França 0131c70175 Merge pull request #21661 from akshay-vishnoi/submit_tag_tests
Fix - Prevent adding of `data-disable-with` option twice in html.
2015-09-29 02:05:07 -03:00
Akshay Vishnoi 23a658ae59 Fix names of test cases 2015-09-29 10:08:30 +05:30
Rafael Mendonça França 30c67000ca Merge pull request #21790 from yui-knk/fix_doc_date_field
[ci skip] Fix which method `FormHelper#date_field` try to call
2015-09-28 00:09:14 -03:00
yui-knk a314879a96 [ci skip] Fix which method `FormHelper#date_field` try to call
When this method was implemented
(https://github.com/rails/rails/pull/5016/files), `to_date` is called.
But this behavior was chagned refactoring
(https://github.com/rails/rails/pull/6452/files).
In the first commit, there were not test which asserts `to_date` is called.

I think trying `to_date` is more useful than trying `strftime`, because
we can write `"2015-01-01".to_date`. But first fix comments to match
actual behavior.
2015-09-27 23:51:21 +09:00
Mehmet Emin İNAÇ 7c2104032b minor doc fix [ci skip] 2015-09-27 05:57:21 +03:00
Kasper Timm Hansen 1d02cba939 Merge pull request #21781 from ronakjangir47/partial_caching_test
Added test cases where collection partial cached & rendered with different keys
2015-09-26 23:06:56 +02:00
Ronak Jangir 5e32b90245 Added test cases where collection partial cached for different key and rendered for different key 2015-09-26 20:19:31 +05:30
Rafael Mendonça França 5b64835601 Merge pull request #21431 from ojab/master
Handle nested fields_for by adding indexes to record_name
2015-09-26 01:51:41 -03:00
Mauro George 578bc4b595 Regression test on CollectionCheckBoxes to accept `include_hidden`
as string
2015-09-24 19:58:21 -03:00
Mauro George 491013e06d Add a hidden field on the collection_radio_buttons
This will avoid a error be raised when the only input on the form is the
`collection_radio_buttons`.
2015-09-24 19:58:15 -03:00
Ronak Jangir a2a5191330 Removed Mocha from Action View 2015-09-23 23:34:04 +05:30
Yves Senn 8842ce2395 Merge pull request #21712 from amitsuroliya/html_fix
Correcting output of `file_field` with `multiple` attribute option [ci skip]
2015-09-22 10:35:47 +02:00
amitkumarsuroliya 851760c0e1 Correcting output of `file_field` with `multiple` attribute option [ci skip] 2015-09-22 14:02:24 +05:30
amitkumarsuroliya f077cc6f41 Correcting output of `number_to_percentage` example in `number_helper` [ci skip]
Here is correct output of `number_to_percentage(100, format: "%n  %”)`
2015-09-22 07:38:02 +05:30
Aaron Patterson d74c8e53b8 compare arrays not set objects. 2015-09-21 14:55:34 -07:00
Sean Griffin b223d729d8 Merge pull request #21612 from ronakjangir47/remove_unused_params
Removed unused parameter `options` for `register_detail` method
2015-09-21 08:30:43 -06:00
Akira Matsuda 64766e82d6 🔪 Typos 2015-09-21 03:17:39 +09:00
Akira Matsuda c971bc0568 ✂️ empty line at the top of files 2015-09-21 01:27:33 +09:00
Jerry D'Antonio 56ac6e4768 Replaced `ThreadSafe::Map` with successor `Concurrent::Map`.
The thread_safe gem is being deprecated and all its code has been merged
into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly
the same as its predecessor except for fixes to two bugs discovered
during the merge.
2015-09-19 09:56:26 -04:00
Aaron Patterson 38d2bf5fd1 mostly remove the ParamsParser middleware
This can still be added to the middleware stack, but is really not
necessary.  I'll follow up with a commit that deprecates the constant
2015-09-18 15:36:55 -07:00
Kasper Timm Hansen 77370f27db Merge pull request #21632 from kirs/feature/translation-helper-include-interpolation
Include interpolation values to translation_missing helper
2015-09-18 21:37:28 +02:00
Kir Shatrov 0f138d1a8b Include interpolation values to translation_missing helper 2015-09-18 20:04:36 +03:00
Akira Matsuda dcecbb4234 File encoding is defaulted to utf-8 in Ruby >= 2.1 2015-09-18 17:05:05 +09:00
Akshay Vishnoi 9331f00229 Fix - Prevent adding of `data-disable-with` option twice in html.
Earlier
when `data-disable-with` option is added direclty as in options then

```ruby
submit_tag("Save", { "data-disable-with" => "Processing..." })
# => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." data-disable-with="Processing..." />
```

Now
when `data-disable-with` option is added direclty as in options then

```ruby
submit_tag("Save", { "data-disable-with" => "Processing..." })
# => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." />
```
2015-09-18 12:44:09 +05:30
shingo.nakanishi 30eabcb921 No need the `a` 2015-09-17 23:18:22 +09:00
shingo.nakanishi 66d6cab987 Fixed helpers submit button Examples [ci skip] 2015-09-17 17:06:54 +09:00
Ronak Jangir e46a117a4c Removed unused parameter `options` for `register_detail` method
This method is only called with name & block.
2015-09-13 21:54:10 +05:30
amitkumarsuroliya ee8feecc57 fix typo intance -> instance in ActionView [ci skip]
`intance` should be `instance`
2015-09-13 20:18:10 +05:30
Rafael Mendonça França f883867dd6 Merge pull request #21502 from bernerdschaefer/bs-polymorphic-url_for-dups-arguments
`url_for` does not modify polymorphic options
2015-09-08 13:49:22 -03:00
Kasper Timm Hansen b5a489fc9c Merge pull request #21480 from amitsuroliya/add_return_value_description
adding description of return value [ci skip]
2015-09-07 07:48:12 +02:00
Aaron Patterson f443ae670d Use ERB::Utils to percent encode `hfvalue` parts of mailto
`hfvalue` parts should always be percent encoded, so lets do that!

Revert "use path escaping for email addresses"

This reverts commit 21ffef38a5.
2015-09-05 10:59:46 -07:00
Aaron Patterson 21ffef38a5 use path escaping for email addresses
Due to e25fdad2f1, we are correctly using
path escaping for email addresses.  This commit fixes the tests to
expect path escaping.
2015-09-04 15:20:07 -07:00
Bernerd Schaefer ee63532d40 `url_for` does not modify polymorphic options
The `url_for` methods in `actionpack` and `actionview`
now make a copy of the provided options
before generating polymorphic paths or URLs.

The bug in the previous behavior
is most noticeable in a case like:

    url_options = [:new, :post, param: 'value']

    if current_page?(url_options)
      css_class = "active"
    end

    link_to "New Post", url_options, class: css_class
2015-09-04 13:42:32 -07:00
amitkumarsuroliya ddc05b61e0 adding description of return value [ci skip] 2015-09-03 17:22:36 +05:30
ojab 7089768b70 Handle nested fields_for by adding indexes to record_name
In case of the form with nested fields_for, i. e.

<%= form_for :foos, url: root_path do |f| %>
    <% @foos.each do |foo| %>
        <%= f.fields_for 'foo[]', foo do |f2| %>
            <%= f2.text_field :id %>
            <% foo.bars.each do |bar| %>
                <%= f2.fields_for 'bar[]', bar do |b| %>
                    <%= b.text_field :id %>
                <% end %>
            <% end %>
        <% end %>
     <% end %>
    <%= f.submit %>
<% end %>

rails doesn't add index for 'foo' in the inner fields_for block, so field names
in the outer fields_for looks like "foos[foo][#{foo_index}][id]" and in the
inner "foos[foo[]][bar][#{bar_index}][id]". Submitting of such form leads to an
error like:
>ActionController::BadRequest (Invalid request parameters: expected Array
>(got Rack::QueryParser::Params) for param `foo'):

This commit adds indexes for the foos in the inner blocks, so field names
become "foos[foo][#{foo_index}][bar][#{bar_index}][id]" and submitting of such
form works fine as expected.

Fixes #15332
2015-08-30 20:44:09 +00:00
Lachlan Sylvester a9c6a583b6 Fix calling cache helper with a relation 2015-08-28 17:26:09 +10:00
Vipul A M 7f23c5d524 - Extracted `DELIMITED_REGEX` to `delimited_regex` method and made use of user passed `options[:delimited_regex]` if available. Changed `DELIMITED_REGEX` to `DEFAULT)DELIMITED_REGEX` to signify what it means.
- Added tests for number to delimited and number to currency in both actionview and activesupport.

Changes

Changes
2015-08-28 11:34:17 +05:30
Yves Senn b8f00b034d Merge pull request #21389 from Gaurav2728/gaurav-unused_require_file
no more require minitest mock here
2015-08-27 13:32:31 +02:00
Aaron Patterson 2ceb16e539 Pull `plain` content type handling up to `render`
`render` is the only possible source for the `plain` option.  Pulling
the conditional up to the `render` method removes far away conditionals
2015-08-26 14:04:04 -07:00
Aaron Patterson fa09bf44db stop passing the options hash to `_process_format`
We don't need to pass the full hash just to pull one value out.  It's
better to just pass the value that the method needs to know about so
that we can abstract it away from "options"
2015-08-26 13:51:28 -07:00
Gaurav Sharma aa1f53f3c7 no more require minitest mock 2015-08-27 02:14:30 +05:30
Rafael Mendonça França 518ae9f055 Pass the correct formats 2015-08-24 15:36:14 -03:00
Rafael Mendonça França face604266 Pass formats to lookup_context
Before we were changing the state of the lookup_context for the duration
of the with_layout_format block, but since we already know the formats
we can just pass it explicitly.

Related with 8d7ce0f22a
2015-08-24 15:16:59 -03:00
Nick Sutterer c0daa02c24 remove useless case in #resolve_layout. 2015-08-24 15:07:25 -03:00
Nick Sutterer 8d7ce0f22a remove LookupContext#with_layout_format by passing formats for layouts explicitely. 2015-08-24 15:07:25 -03:00
Ronak Jangir 0a5b08a1e7 Removed Mocha from ActionView part 1 2015-08-24 08:59:19 +05:30
amitkumarsuroliya bb289b9409 fix Docs [ci skip] 2015-08-18 00:41:17 +05:30
amitkumarsuroliya f2c04d77ba typo fix [ci skip] 2015-08-18 00:02:16 +05:30
Sean Griffin 249a06d3be Merge pull request #21135 from DropsOfSerenity/master
make disable_with default in submit_tag
2015-08-17 06:49:00 -06:00
Claudio B. 0e5ffa740c Merge pull request #21253 from vincefrancesi/date-helper-use-hidden-documentation
Documentation for ActionView::Helpers::DateHelper :use_hidden option
2015-08-16 08:41:20 -07:00
eileencodes 2ae68eef39 Fix test assign_parameter method signature
Oops, I broke the build :(

Fixes the method signature of `assign_parameters` which now takes 6
arguments instead of 4. We likely will end up chaning the method
signature further so good to know this test is here.
2015-08-15 16:33:39 -04:00
Vince Francesi cfde3786e7 Add documentation for ActionView::Helpers::DateHelper :use_hidden option [ci skip] 2015-08-15 12:36:54 -07:00
Justin Schiff 3822a322a8 Make disable_with default in submit_tag
Prevents double submission by making disable_with the default.

Default disable_with option will only be applied if user has not
specified her/his own disable_with option, whether that is in the
`data-disable-with` string form or the
`:data => { :disable_with => "Saving..." }` hash form. disable_with
will default to the value attribute.

A configuration option was added to opt out of this functionality if
the user so desires.
`config.action_view.automatically_disable_submit_tag = false`
2015-08-11 16:35:10 -07:00
Mauricio Gomez Aguinaga cf93c6ae48 Sometimes you need a specific break sequence while using word wrap and as today the only option we have is "\n" and is hardcoded.
With this change you will be able to specify any break sequence ("\r\n" for example) as an option.

adding proper documentation for break_sequence in ActionView::Helpers::TextHelper.word_wrap

adding some more documentation for word_wrap custom break sequence and making sure we use new hash syntax
2015-08-11 14:15:47 -07:00
Arthur Nogueira Neves 2117a535b5 Merge pull request #21187 from arthurnn/method_missing_routes_av
Dont try to call method missing in routes if thats not what we want
2015-08-11 16:10:41 +02:00
Arthur Neves 0ffaa56d51
Dont try to call method missing in routes if thats not what we want
If, doing a test like this:

```
class BugTest < ActionView::TestCase
  def test_foo
    omg
  end
```

Will raise with:
```
RuntimeError: In order to use #url_for, you must include routing helpers
explicitly. For instance, `include
Rails.application.routes.url_helpers`.
```

Thats a bit confusing, as we are not calling url_for at all.
2015-08-10 22:16:52 +02:00
Kasper Timm Hansen 44a7fe673a [ci skip] Fix simultaneous spelling 2015-08-10 22:00:09 +02:00
Derek Prior 0d8b552c68
Update info on browser connection limits [ci skip]
Browsers have not been limited to two connections per host for quite
some time now. With more connections allowed, the trade-off involved in
asset host distribution isn't so clear and it becomes more important
that developers measure actual performance before and after.
2015-08-10 15:44:35 -04:00
eileencodes 12f08acbac Fix deprecation warning in tests
Using the string version of the class reference is now deprecated when
referencing middleware. This should be written as a class not as a string.

Deprecation warning that this change fixes:
```
DEPRECATION WARNING: Passing strings or symbols to the middleware
builder is deprecated, please change
them to actual class references.  For example:
  "ActionDispatch::ShowExceptions" => ActionDispatch::ShowExceptions
```
2015-08-08 10:38:09 -04:00
Benjamin Quorning d531edc829 Save a string allocation inside loop
In the `tag_options` method, strings are continuously added to the
`output` string. Previously, we concatenated two strings and added the
generated string to `output`. By adding each of the strings to
`output`, one after the other, we will save the allocation of that
concatenated string.

Benchmark:

    require 'benchmark/ips'

    sep = " ".freeze

    Benchmark.ips do |x|
      x.report("string +") {
        output = ""
        output << sep + "foo"
      }
      x.report("string <<") {
        output = ""
        output << sep
        output << "foo"
      }
      x.compare!
    end

Results (Ruby 2.2.2):

    Calculating -------------------------------------
                string +    88.086k i/100ms
               string <<    94.287k i/100ms
    -------------------------------------------------
                string +      2.407M (± 5.8%) i/s -     12.068M
               string <<      2.591M (± 7.0%) i/s -     12.917M

    Comparison:
               string <<:  2591482.4 i/s
                string +:  2406883.7 i/s - 1.08x slower
2015-08-02 14:31:07 +02:00
schneems 005541b83e zOMG 37 objects saved 2015-07-30 12:31:05 -05:00
schneems 1f831fefe2 Don't allocate array when not necessary
In the `tag_options` method an array is used to build up elements, then `Array#*` (which is an alias for `Array#join` is called to turn the array into a string. Instead of allocating an array to build a string, we can build the string we want from the beginning.

Saved: 121,743 bytes 893 objects
2015-07-30 12:31:05 -05:00
schneems e76a843505 Cut string allocations in content_tag_string
content_tag's first argument is will generate a string with an html tag so `:a` will generate: `<a></a>`. When this happens, the symbol is implicitly `to_s`-d so a new string is allocated. We can get around that by using a frozen string instead which

This change buys us 74,236 bytes of memory and 1,855 fewer objects per request.
2015-07-29 20:41:58 -05:00
schneems 9b189a3169 Cut string ActionView template allocations
The instrument method creates new strings, the most common action to instrument is "!render_template` so we can detect when that action is occurring and use a frozen string instead.

This change buys us 113,714 bytes of memory and 1,790 fewer objects per request.
2015-07-29 20:41:58 -05:00
schneems 2e95d2ef90 Optimize hash key
No idea why on earth this hash key isn't already optimized by MRI, but it isn't. 💩

This change buys us 74,077 bytes of memory and 1,852 fewer objects per request.
2015-07-29 20:41:58 -05:00
schneems 2a4d4301d4 Decrease string allocation in content_tag_string
When an unknonwn key is passed to the hash in `PRE_CONTENT_STRINGS` it returns nil, when you call "#{nil}" it allocates a new empty string. We can get around this allocation by using a default value `Hash.new { "".freeze }`. We can avoid the `to_sym` call by pre-populating the hash with a symbol key in addition to a string key.

We can freeze some strings when using Array#* to reduce allocations.

Array#join can take frozen strings.

This change buys us 86,600 bytes of memory and 1,857 fewer objects per request.
2015-07-29 20:41:58 -05:00
Kasper Timm Hansen c5583cd79c Merge pull request #20904 from kaspth/wildcard-template-dependencies
Add wildcard template dependencies.
2015-07-27 20:27:57 +02:00
Kasper Timm Hansen a6509d3112 Add wildcard template dependencies. 2015-07-26 19:21:14 +02:00
Clayton Smith 6a38782477 Encode the email address as prescribed in RFC 6068 section 2. 2015-07-23 16:56:21 -04:00
Sean Griffin fd9c952f14 Merge pull request #20895 from brian-davis/brian-davis
grammar fix to content_for method documentation in capture_helper.rb [ci skip]
2015-07-20 08:36:49 -06:00
David Heinemeier Hansson 068865a7d5 Merge pull request #20384 from kaspth/per-request-cache
Use digest cache in development.
2015-07-20 13:15:55 +02:00
schneems 5bb1d4d288 Freeze string literals when not mutated.
I wrote a utility that helps find areas where you could optimize your program using a frozen string instead of a string literal, it's called [let_it_go](https://github.com/schneems/let_it_go). After going through the output and adding `.freeze` I was able to eliminate the creation of 1,114 string objects on EVERY request to [codetriage](codetriage.com). How does this impact execution?

To look at memory:

```ruby
require 'get_process_mem'

mem = GetProcessMem.new
GC.start
GC.disable
1_114.times { " " }
before = mem.mb

after = mem.mb
GC.enable
puts "Diff: #{after - before} mb"

```

Creating 1,114 string objects results in `Diff: 0.03125 mb` of RAM allocated on every request. Or 1mb every 32 requests.

To look at raw speed:

```ruby
require 'benchmark/ips'

number_of_objects_reduced = 1_114

Benchmark.ips do |x|
  x.report("freeze")    { number_of_objects_reduced.times { " ".freeze } }
  x.report("no-freeze") { number_of_objects_reduced.times { " " } }
end
```

We get the results

```
Calculating -------------------------------------
              freeze     1.428k i/100ms
           no-freeze   609.000  i/100ms
-------------------------------------------------
              freeze     14.363k (± 8.5%) i/s -     71.400k
           no-freeze      6.084k (± 8.1%) i/s -     30.450k
```

Now we can do some maths:

```ruby
ips = 6_226k # iterations / 1 second
call_time_before = 1.0 / ips # seconds per iteration 

ips = 15_254 # iterations / 1 second
call_time_after = 1.0 / ips # seconds per iteration 

diff = call_time_before - call_time_after

number_of_objects_reduced * diff * 100

# => 0.4530373333993266 miliseconds saved per request
```

So we're shaving off 1 second of execution time for every 220 requests. 

Is this going to be an insane speed boost to any Rails app: nope. Should we merge it: yep. 

p.s. If you know of a method call that doesn't modify a string input such as [String#gsub](b0e2da69f0/lib/let_it_go/core_ext/string.rb (L37)) please [give me a pull request to the appropriate file](b0e2da69f0/lib/let_it_go/core_ext/string.rb (L37)), or open an issue in LetItGo so we can track and freeze more strings. 

Keep those strings Frozen

![](https://www.dropbox.com/s/z4dj9fdsv213r4v/let-it-go.gif?dl=1)
2015-07-19 17:45:10 -05:00
Kasper Timm Hansen 7bd70bae14 Remove unused persistent option. 2015-07-18 21:54:19 +02:00
Kasper Timm Hansen 40f79da8f2 Make digest cache work in development.
Avoid computing the same fragment digest many times when looping over templates.

The cache is cleared on every request so template changes are still picked up.
2015-07-18 21:54:19 +02:00
Prem Sichanugrist 8cb8ce98d9 Stop using deprecated `render :text` in test
This will silence deprecation warnings.

Most of the test can be changed from `render :text` to render `:plain`
or `render :body` right away. However, there are some tests that needed
to be fixed by hand as they actually assert the default Content-Type
returned from `render :body`.
2015-07-17 22:27:33 -04:00
Jon Atack ea747f7d2e [skip ci] Lookup can be a noun but it is not a verb
Various grammar corrections and wrap to 80 characters.
2015-07-17 20:18:57 +02:00
Brian Davis 5334889a27 grammar fix to content_for method documentation in capture_helper.rb 2015-07-15 21:19:17 -06:00
Prem Sichanugrist 14a3bd520d Make AC::Parameters not inherited from Hash
This is another take at #14384 as we decided to wait until `master` is
targeting Rails 5.0. This commit is implementation-complete, as it
guarantees that all the public methods on the hash-inherited Parameters
are still working (based on test case). We can decide to follow-up later
if we want to remove some methods out from Parameters.
2015-07-15 11:11:36 -04:00
Prem Sichanugrist e26d11c876 Change AC::TestResponse to AD::TestResponse
ActionController::TestResponse was removed in d9fe10c and caused a test
failure on Action View as its test case still refers to it.
2015-07-14 09:27:42 -04:00
Kasper Timm Hansen 87b4f3105f Merge pull request #20813 from noniq/locale-argument-for-pluralize-helper
Allow `pluralize` helper to take a locale.
2015-07-09 21:24:24 +02:00
Stefan Daschek bb851651f1 Allow `pluralize` helper to take a locale.
This is already supported in `ActiveSupport::Inflector#pluralize` and `String#pluralize`, so we just forward the locale.
2015-07-09 14:51:13 +02:00
Aaron Patterson 2838a1f4ac use new constructor. (Oops! 💣) 2015-07-08 16:38:01 -07:00
Dov Murik 5a41d00455 Support explicit defintion of resouce name for collection caching.
If a template includes `# Template Collection: ...` anywhere in its
source, that name will be used as the cache name for the partial that is
rendered for the collection.

This allows users to enable collection caching even if the template
doesn't start with `<% cache ... do %>`.

Moreover, the `# Template Collection: ...` notation is recognized in all
template types (and template types other than ERB can define a
resource_cache_call_pattern method to allow the `cache ... do` pattern
to be recognized too).
2015-07-07 16:57:09 -04:00
Thomas Osborn b3bfbbf10e changes names in guides to better reflect diversity [ci-skip] 2015-07-02 16:21:28 -07:00
Yves Senn d4b0e5f59f Merge pull request #20669 from akolomiychuk/image-path
Passing nil to image_tag
2015-06-29 10:52:00 +02:00
Anton Kolomiychuk 42a1b0c7c3 Add nil check in asset_path 2015-06-29 14:03:29 +06:00
Roque Pinel da1674576d Fix cache issue when different partials use the same collection
Adds the `virtual_path` option to `cache_fragment_name` so it can
be provided when needed.

That allows `cache_collection_render` to get the appropriate cache
key with the digest generated based on the template and prevent
collision with other templates that cache the same collection.
2015-06-28 20:41:59 -05:00
Kasper Timm Hansen f9996803f8 Merge pull request #20417 from dubek/fix-template-cache-call-pattern
Improve detection of partial templates eligible for collection caching.
2015-06-26 23:01:07 +02:00
Robin Dupret e09129c94c A few documentation fixes [ci skip] 2015-06-23 17:55:37 +02:00
Dov Murik d51e2eefd5 Improve detection of partial templates eligible for collection caching.
The regular expression which was used to detect partial templates that
begin with a `<% cache ... do %>` call missed some cases.  This commits
attempts to improve the detection for some cases such as multi-line
comments at the beginning of the template.  The different templates are
listed in two new unit test methods.

Note that specially crafted Ruby code can still evade such `cache`-call
detection: for example, a user might have its own method which itself
calls the Rails `cache` helper. In such a case, the template's code
doesn't start with a literal `cache` string and therefore will not be
eligible for collection caching.
2015-06-22 14:17:08 -04:00
Richard Schneeman 0fccf646e1 Merge pull request #20654 from repinel/remove-duplicate-private
Remove duplicate private statement
2015-06-21 21:26:03 -05:00
Vijay Dev f6797a7683 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/configuring.md
2015-06-21 18:37:55 +00:00
Roque Pinel fe08c816d0 Remove duplicate private statement 2015-06-21 13:51:59 -04:00
Xavier Noria 29959eb59d applies project style guidelines
Just saw these in passing while reading this file.
2015-06-20 23:40:11 +02:00
Xavier Noria d8c22275fa removes unnecessary backslashes in regexps
Colons are not metacharacters.
2015-06-20 23:08:51 +02:00
Zachary Scott 4d8abebf4e Nitpick 💅 [ci skip] 2015-06-18 17:39:59 -04:00
Zachary Scott dd1ac54157 Merge pull request #20549 from maurogeorge/distance_of_time_in_words-rdoc
Add RDoc about scope option on distance_of_time_in_words
2015-06-18 17:28:38 -04:00
Mauro George f6d325eda4 Add RDoc about scope option on distance_of_time_in_words
[ci skip]
2015-06-18 18:08:49 -03:00
Arthur Nogueira Neves e08d8c5b4a Merge pull request #20108 from akshay-vishnoi/button-tag
Add missing spec and documentation for button_tag helper
2015-06-15 22:55:58 +02:00
Arthur Nogueira Neves d3894b9927 Merge pull request #20107 from ankit8898/av_refac_record_tag_helper
Removed not needed includes, As record_tag_helper is moved to a gem we..
2015-06-15 22:28:27 +02:00
Zachary Scott 88cd09fa47 Merge pull request #20548 from maurogeorge/collection_check_boxes-rdoc-gotcha
Add gotcha to RDoc of collection_check_boxes
2015-06-14 09:24:42 -04:00
yui-knk 387cc157f8 [ci skip] Fix to Fixed-width Font
LookupContext is class name
2015-06-14 13:35:34 +09:00
yui-knk fdb301583f [ci skip] Add '.' 2015-06-14 12:33:30 +09:00
Mauro George 58a75ffbfe Add gotcha to RDoc of collection_check_boxes
[ci skip]
2015-06-13 17:06:00 -03:00
Matthew Draper def14505b7 Revert "revises a test to account for case-insensitive file systems"
This reverts commit d345ce9630.
2015-06-14 02:46:40 +09:30
Yves Senn 1d43458c14 Merge pull request #20480 from senny/test_runner
use our own runner for Rails framework components `bin/test`
2015-06-12 17:19:47 +02:00
Rafael Mendonça França fcbd2e821e Merge pull request #20058 from farukaydin/cache-digests-dependency-rake
add error log that notify 'file not found' when using cache_digest dependency rake
2015-06-11 20:37:09 -03:00
Jorge Bejar e3808878c6 Exclude cache_digests:dependencies rake task in api app 2015-06-11 16:54:14 -03:00
Yves Senn 9946788775 select the AR adapter through `bin/test`. 2015-06-11 14:24:56 +02:00
Yves Senn 54d84cbb77 use our runner (`bin/test`) for framework components.
This adds a script `bin/test` to most Rails framework components. The
script uses the rails minitest plugin to augment the runner.
See https://github.com/rails/rails/pull/19571 for details about the
plugin.

I did not yet add `bin/test` for activerecord, activejob and railties.
These components rely on specific setup performed in the rake-tasks.
2015-06-11 14:12:15 +02:00
Robin Dupret 0b57f090c9 Tiny documentation edits [ci skip] 2015-06-09 11:49:33 +02:00
Grey Baker 0775407384 Raise an ArgumentError when `include_blank` is false for a required field in
`Tags::Base#select_content_tag`.

Previously, passing a falsey value to `include_blank` would be ignored if the
field was required, and a blank line would still be inserted. The following will
now raise instead of quietly failing:

`select("post", "category", %w(a required field), { include_blank: false }, required: 'required')`
2015-06-08 16:41:44 +01:00
yui-knk cbd71795bc [ci skip] Fix minutes to seconds in `select_second`
This is same type commit of https://github.com/rails/rails/pull/20463
2015-06-09 00:12:06 +09:00
yui-knk 4071caad2a [ci skip] Fix hours to minutes in `select_minute` 2015-06-07 21:56:26 +09:00
Vijay Dev 423f14183f Merge branch 'master' of github.com:rails/docrails 2015-06-05 19:49:44 +00:00
Rafael Mendonça França 8193a09a1f Revert "Merge pull request #19685 from vngrs/actionview_parent_layout_bug"
This reverts commit a9d58c77da, reversing
changes made to 041c2c879a.

Reason: The old behavior is how it was working in previous version of
Rails since 4.0.x so it is not safe to backport to a stable branch.

See https://github.com/rails/rails/issues/19626#issuecomment-89862258
and https://github.com/rails/rails/pull/15050#issuecomment-45333449
2015-06-02 20:57:54 -03:00
Guo Xiang Tan ca83436d1b Remove `assigns` and `assert_template`. 2015-05-30 14:13:57 +08:00
Rafael Mendonça França 233ceda594 Merge pull request #20331 from arunagw/arunagw-remove-unused-package-tasks
Remove unused package tasks
2015-05-28 18:48:21 -03:00
Mehmet Emin İNAÇ 44781b6e97 Deprecate `:nothing` option for render method
`head` method works similar to `render` method with `:nothing` option
2015-05-28 15:13:32 +03:00
Arun Agrawal 21b6b68f63 Remove unused package tasks
We are using `all:build` now.
2015-05-28 09:06:10 +02:00
Rafael Mendonça França be18476fb2 Merge pull request #20263 from arunagw/aa-remove-custom-lines-actionview
Remove custom `lines` and use `/tools/line_statistics`
2015-05-28 01:10:47 -03:00
Yves Senn 852460852c Merge pull request #20262 from arunagw/aa-remove-broken-unused-release-task
Remove broken and unused release task
2015-05-27 09:14:19 +02:00
Yoong Kang Lim 7c988f8030 Use ActiveSupport::SafeBuffer when flushing content_for
Previously, when content_for is flushed, the content
was replaced directly by a new value in
ActionView::OutputFlow#set. The problem is this new
value passed to the method may not be an instance of
ActiveSupport::SafeBuffer.

This change forces the value to be set to a new
instance of ActiveSupport::SafeBuffer.
2015-05-25 22:13:03 +10:00
Akshay Vishnoi b5ae29de03 Add missing spec and documentation for button_tag helper 2015-05-24 10:07:54 +05:30
claudiob 6df6134e7c [ci skip] Fix typo you/your 2015-05-23 10:23:05 -07:00
Arun Agrawal b9e0073b41 Remove custom `lines` and use `/tools/line_statistics` 2015-05-22 16:35:08 +02:00
Arun Agrawal 4194d052d8 Remove broken and unused release task
- We do release with release.rb
- There is no `rake/gemcutter`
2015-05-22 14:30:30 +02:00
Guo Xiang Tan 3d4004ab63 Remove deprecation warning.
https://travis-ci.org/rails/rails/jobs/63594316#L1982
2015-05-22 19:16:47 +08:00
Xavier Noria d345ce9630 revises a test to account for case-insensitive file systems
The patched test assumed the file system is case-sensitive, but that is not
necessarily the case. In particular, this test did not pass in the recommended
setup for the dev box, because the /vagrant shared folder is case-insensitive.

After looking at some gems that provide access to file system metadata I have
chosen to go with the check you can see in the patch because, albeit it's a bit
dirty creating a file, it is super easy to understand and clearly portable.

References https://github.com/rails/rails-dev-box/issues/102.
2015-05-21 21:45:51 +02:00
Carlos Antonio da Silva df93b4d113 Fix docs markup for option_groups_from_collection_for_select [ci skip] 2015-05-19 23:27:56 -03:00
karanarora 644897a2b1 spelling fix [ci skip] 2015-05-19 23:47:35 +05:30
Prathamesh Sonpatki daba090dec Pass over CHANGELOGS [ci skip] 2015-05-16 11:00:17 +05:30
Henrik Nygren bef9484cf8 Do not put partial name to local_assigns when rendering without an object
When one rendered a partial template without specifying an object
or a collection (e.g. <%= render partial: 'partial_name' %>), Rails
would make an object called :partial_name available in local_assigns.
I don't think this was the intended behavior, since no local variable
called 'partial_name' gets defined in the view.
2015-05-14 10:46:44 +03:00
Rafael Mendonça França c1104a91f6 Merge pull request #20149 from karanarora/Typo-fix
remove redundant parenthesis.
2015-05-13 18:29:11 -03:00
karanarora e6f0a5372e remove redundant parenthesis. 2015-05-14 02:52:49 +05:30
claudiob 0080a886b2 [ci skip] Don’t encourage `sudo gem install`
I think we are better off leaving `sudo` outside of the documented
way of installing gems (`activerecord`, `actionpack`, …).

We don’t want newbies to think that `sudo` is required or, even worse, than
they actually have to type `[sudo] gem install`.

In most scenarios, `sudo` is not needed to install gems, and people who do
need it, probably already know about it.

What do you think? 😁
2015-05-12 14:51:19 -07:00
Ankit Gupta 350659412f Removed not needed includes, As record_tag_helper is moved to a gem we are not
testing is completely here now. RenderErbUtils and AM::Conversion are not used
2015-05-10 20:48:34 -04:00
Gourav Tiwari 333ecdcb56 Better formatted documents [ci skip] 2015-05-08 10:15:36 -07:00
Vijay Dev 9c290fbe7f Merge branch 'master' of github.com:rails/docrails 2015-05-08 16:20:27 +00:00
yui-knk 92c0af2174 [ci skip] Add an example to ActionView::Helpers::FormBuilder#label 2015-05-08 21:37:17 +09:00
Gourav Tiwari cf54bbd713 Updated dynamic value of id in comments [ci skip]
In help text for method, dynamic value makes it hard to understand, so replaced with static value matching with example above
2015-05-07 19:45:07 +00:00
Ankit Gupta 37f4b94190 Example updated [ci skip]
Should be ApplicationController not ApplicationController::Base
2015-05-07 14:53:56 -04:00
Faruk AYDIN 5b196452a5 add error log that notify 'file not found' when using cache_digests:dependency and cache_digests:nested_dependency tasks 2015-05-07 20:17:45 +03:00
Yves Senn 918aa6e878 use the right assertions.
Prompted by:
e38dd7bfa4 (commitcomment-11011496)

/cc @kuldeepaggarwal
2015-05-05 09:55:05 +02:00
Bernard Potocki 3d8b783d13 Remove :rescue_format option for translate helper since it's no longer supported by I18n. 2015-05-04 23:46:25 +02:00
Matthew Draper a95151bb13 Merge pull request #19998 from imanel/fix-missing-translation
Handle raise flag in translate when both main and default translation is missing.
2015-05-05 06:53:13 +09:30
Bernard Potocki 9c8542bb12 Handle raise flag in translate when both main and default translation is missing. Fixes #19967 2015-05-04 22:26:07 +02:00