Commit Graph

960 Commits

Author SHA1 Message Date
Mehmet Emin İNAÇ
e4dd700b5d Use ruby 1.9 lambda syntax in documentations [ci skip] 2015-05-03 02:50:31 +03:00
yui-knk
de397954e6 [ci skip] Fix example codes of form_for method 2015-05-02 09:09:49 +09:00
Yves Senn
e38dd7bfa4 add test-case for link_to_if behavior with a block.
This illustrates the purpose of the block for `link_to_if` and
`link_to_unless` helper methods.

It should help to prevent further mistakes like #19844.
2015-05-01 11:12:56 +02:00
Yves Senn
14d0e07026 Revert "Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition"
This reverts commit d459b001b43d25053e7982e96eb8383538a6e358, reversing
changes made to 4d4950fae9e2a6970b5f1793aadc56a0b44e28a3.

😓

The block is not supposed to be passed to `link_to`. It's used for a
customized behavior of the `condtion = false` case. The docs
illustrate that like so:

```
<%=
   link_to_if(@current_user.nil?, "Login", { controller: "sessions", action: "new" }) do
     link_to(@current_user.login, { controller: "accounts", action: "show", id: @current_user })
   end
%>
```
2015-05-01 11:02:56 +02:00
Yves Senn
d459b001b4 Merge pull request #19844 from stevenspiel/link_to_if_block_helper_addition
Update url_helper.rb
2015-05-01 10:54:23 +02:00
Javan Makhmali
20f6f646d1 Make ActionMailer #cache helper a no-op, not an exception 2015-04-28 13:56:42 -06:00
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 479c7cacd5db58ab7200bc1de58c829a1a643278
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
Steven Spiel
58c3a04512 Update url_helper.rb
add block to link_to_if when condition is true
2015-04-21 09:38:20 -04: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 92a3c8dcdf174dab5e8759031b6bbe6cd891fe3c 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 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing
changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
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