Commit Graph

953 Commits

Author SHA1 Message Date
Zachary Scott 7f50d63f51 Merge pull request #19892 from derekprior/dp-translate-helper-docs
Correct translate helper docs [ci skip]
2015-04-25 14:02:41 -04:00
Akira Matsuda 2fab16142e 🚮 Unused methods 2015-04-25 17:09:33 +09:00
Akira Matsuda 6a4771fd6e 🚮 Unused method
This method is not in use since 479c7cacd5
2015-04-25 17:09:33 +09:00
Derek Prior 6ad5e7ebeb
Correct translate helper docs [ci skip]
The documentation previously stated that calling `translate(".foo")` was
equivalent to calling `I18n.translate("people.index.foo")` which is
incorrect due to the various other functions of the `translate` view
helper. This has been fixed.

Additionally, a note about forcing the view helper to re-raise
exceptions was added to the section detailing the handling of missing
translations.

Other cleanup includes:

* Consistent formatting of code
* Stop indenting bulleted list as a code sample
* Tighten some of the language
* Wrap at 80 characters.
2015-04-24 11:45:35 -04:00
Prem Sichanugrist 5efd823d9b Silence warning from requiring mathn
Running Action View test case currently printing out this warning:

    lib/mathn.rb is deprecated

This should silence the warning since we really want to require this
file in this test.
2015-04-22 11:49:35 -04:00
Yves Senn cdbf685994 pass over CHANGELOGs. [ci skip] 2015-04-22 14:44:30 +02:00
Mehmet Emin İNAÇ b0e17b9af4 fix typo asser url [ci skip] 2015-04-16 00:46:07 +03:00
Abdelkader Boudih 8d11151aba Merge pull request #19774 from davydovanton/doc-update-asser-url
[Skip ci] Add information about :host options
2015-04-15 22:23:06 +01:00
Anton Davydov a4d589e31e [Skip ci] Add information about :host options
Added informations about :host options for each url helper
(#javascript_url, #video_url, #stylesheet_url, etc) based on #asser_url
method.
2015-04-16 00:05:17 +03:00
Rafael Mendonça França 9ec54d9500 Merge pull request #19736 from kmcphillips/master
Set default form builder for a controller
2015-04-14 11:23:49 -04:00
Guillermo Iguaran 33ea933d7b Merge pull request #19753 from jonatack/use-ruby-2-2-2
Upgrade to Ruby 2.2.2
2015-04-13 22:56:47 -05:00
Kevin McPhillips 2b8acdcd21 Override default form builder for a controller 2015-04-13 23:43:34 -04:00
Jon Atack 32f7491808 Upgrade to Ruby 2.2.2
and fix the grammar in the ruby_version_check.rb user message.
2015-04-14 08:41:56 +05:30
Vijay Dev 8ac458ad2e Merge branch 'master' of github.com:rails/docrails 2015-04-14 02:07:26 +00:00
Richard Schneeman 29d40544b1 Merge pull request #19566 from aditya-kapoor/remove-dup-doc
[ci skip] remove duplicate doc for current_page?
2015-04-11 17:24:14 -05:00
Zachary Scott 77a7c4bf7d Merge pull request #17512 from JackDanger/danger/use-default-view-pattern-in-docs
[docs] Using the real resolver pattern in docs
2015-04-10 17:03:48 -07:00
Aditya Kapoor 14d1dc219a [ci skip] remove duplicate doc for current_page? 2015-04-09 23:49:10 +05:30
Rafael Mendonça França a9d58c77da Merge pull request #19685 from vngrs/actionview_parent_layout_bug
fix for actionview parent layout bug
2015-04-08 19:14:59 -03:00
yui-knk c1a1c58a93 [ci skip] Add `,` 2015-04-08 19:58:44 +09:00
Mehmet Emin İNAÇ c51aa9f6f2 fix for actionview parent layout bug
This commit fixes issue #19626
Don't need to check layout conditions if there is no condition

test for parent layout bug fix
2015-04-08 11:39:29 +03:00
Rafael Mendonça França 693b333920 Merge pull request #19661 from Azdaroth/fields-for-child-index-lambda
Accept lambda as child_index option in #fields_for method
2015-04-06 19:25:03 -03:00
Karol Galanciak a813fa09a8 Accept lambda as child_index option in #fields_for method 2015-04-05 21:51:19 +02:00
Stephen Bussey 0de4a23d1c head no_content when there is no template or action performed 2015-04-05 15:46:50 -04:00
Yves Senn 0eab204c0e Merge pull request #19644 from y-yagi/auto_discovery_link_tag_doc
correct output of auto_discovery_link_tag [ci skip]
2015-04-05 10:55:13 +02:00
Matthew Draper 07875e2aa6 Merge pull request #19649 from aprescott/allow-array-defaults
Allow an array to be a default translation value.
2015-04-05 02:55:00 +09:30
Adam Prescott 6f3c65f630 Allow an array to be a default translation value.
4.2.1 introduced a change to the way `translate`/`t` works with an
option of `default: [[]]`. In 4.2.0, this would give a default value of
`[]`, but in 4.2.1, it leads to a missing translation.

`default: [[]]` is again allowed for cases where a default of `[]` is
needed.

This addresses GitHub issue 19640.
2015-04-04 12:46:45 -04:00
yuuji.yaginuma e2d9e85368 correct output of auto_discovery_link_tag [ci skip] 2015-04-04 07:37:23 +09:00
Anton Davydov dd2be69ce7 [skip ci] Update information about #link_to attributes 2015-04-04 00:18:40 +03:00
brainopia 58d75fd811 Freeze static arguments for gsub 2015-04-02 02:15:07 +03:00
brainopia cdac52e124 Prefer string patterns for gsub
https://github.com/ruby/ruby/pull/579 - there is a new optimization
since ruby 2.2

Previously regexp patterns were faster (since a string was converted to
regexp underneath anyway). But now string patterns are faster and
better reflect the purpose.

  Benchmark.ips do |bm|
    bm.report('regexp') { 'this is ::a random string'.gsub(/::/, '/') }
    bm.report('string') { 'this is ::a random string'.gsub('::', '/') }
    bm.compare!
  end
  # string: 753724.4 i/s
  # regexp: 501443.1 i/s - 1.50x slower
2015-04-02 02:07:45 +03:00
Anton Davydov fd9d7312a3 [skip ci] Add information about #link_to target option 2015-04-01 18:32:55 +03:00
Yves Senn d5943ab9f2 Merge pull request #19535 from JuanitoFatas/doc/av-comment
[ci skip] Unify the code comment in ActionView::Renderer#render_template...
2015-03-27 08:38:12 +01:00
Juanito Fatas 58130cf1fe Add missing :html option in determine_template error message. 2015-03-27 03:30:11 +08:00
Juanito Fatas fd18db0d87 [ci skip] Unify the code comment in ActionView::Renderer#render_template. 2015-03-27 03:24:17 +08:00
Vijay Dev c26ee64b92 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/4_0_release_notes.md
2015-03-26 16:22:41 +00:00
yui-knk 194edcf67e [ci skip] Fix `&>` with `%>` 2015-03-25 13:22:40 +09:00
Carlos Antonio da Silva 0347280035 Simplify setting button form options
No need to merge hashes when simply setting options does the job.
2015-03-22 20:27:01 -03:00
Carlos Antonio da Silva 9f98cf556d Rework form helper example to use Person.new
The previous change 92a3c8dcdf improved
this example, but calling .create + #valid? ends up running validations
twice, and we don't want to showcase that.

Lets use the normal use case of building a new object and calling #save
on it, which is what a basic scaffold with Active Record does.

[ci skip]
2015-03-21 14:56:24 -03:00
yui-knk cd83775858 [ci skip] Check a result of `valid?` instead of `create` 2015-03-21 09:30:48 +09:00
Rafael Mendonça França 7815fe4634 Merge pull request #19421 from jcoyne/translate_defaults_with_nil
Strip nils out of default translations. Fixes #19419
2015-03-20 18:00:01 -03:00
yui-knk e1440b2649 [ci skip] Add a line between code example and docs 2015-03-21 00:37:47 +09:00
Jeremy Kemper 5154089c18 Revert "Merge pull request #19404 from dmathieu/remove_rack_env"
Preserving RACK_ENV behavior.

This reverts commit 7bdc7635b8, reversing
changes made to 45786be516.
2015-03-20 08:14:11 -07:00
Akshay Vishnoi 01d39787ed [Fix Select tag Tests] Test correct use of multiple option for select 2015-03-20 00:03:17 +05:30
Damien Mathieu d578cbfb5c don't fallback to RACK_ENV when RAILS_ENV is not present 2015-03-19 10:06:28 +01:00
Carlos Antonio da Silva e121fae966 Remove additional handling of boolean attributes on button to helper
This logic was just doing duplicated work, since the button_to helper
relies on tag/content_tag to generate the button html, which already
handles all boolean attributes it knows about.

The code dates back to 2005: 43c470fae4.
2015-03-18 07:34:16 -03:00
Brandon Weiss 0965863564 Closes rails/rails#18864: Renaming transactional fixtures to transactional tests
I’m renaming all instances of `use_transcational_fixtures` to
`use_transactional_tests` and “transactional fixtures” to
“transactional tests”.

I’m deprecating `use_transactional_fixtures=`. So anyone who is
explicitly setting this will get a warning telling them to use
`use_transactional_tests=` instead.

I’m maintaining backwards compatibility—both forms will work.
`use_transactional_tests` will check to see if
`use_transactional_fixtures` is set and use that, otherwise it will use
itself. But because `use_transactional_tests` is a class attribute
(created with `class_attribute`) this requires a little bit of hoop
jumping. The writer method that `class_attribute` generates defines a
new reader method that return the value being set. Which means we can’t
set the default of `true` using `use_transactional_tests=` as was done
previously because that won’t take into account anyone using
`use_transactional_fixtures`. Instead I defined the reader method
manually and it checks `use_transactional_fixtures`. If it was set then
it should be used, otherwise it should return the default, which is
`true`. If someone uses `use_transactional_tests=` then it will
overwrite the backwards-compatible method with whatever they set.
2015-03-16 11:35:44 -07:00
Thiago Pradi 56a7f156af Cleaning JavaScriptHelperTest 2015-03-14 16:37:42 -03:00
Thiago Pradi cc67dd9644 Cleaning unused views from actionpack tests inside actionview 2015-03-14 16:32:03 -03:00
Thiago Pradi abacce174c Zlib isn't required for AssetTagHelperTest anymore 2015-03-14 16:19:43 -03:00
Thiago Pradi c9cab9c74c Cleaning unused methods from abstract_unit 2015-03-14 16:17:42 -03:00