1. 21 11月, 2014 1 次提交
  2. 20 11月, 2014 1 次提交
  3. 19 11月, 2014 2 次提交
  4. 18 11月, 2014 1 次提交
  5. 02 11月, 2014 1 次提交
  6. 01 11月, 2014 1 次提交
  7. 31 10月, 2014 1 次提交
  8. 30 10月, 2014 1 次提交
  9. 29 10月, 2014 2 次提交
    • X
      edit pass over all warnings · e595d91a
      Xavier Noria 提交于
      This patch uniformizes warning messages. I used the most common style
      already present in the code base:
      
      * Capitalize the first word.
      
      * End the message with a full stop.
      
      * "Rails 5" instead of "Rails 5.0".
      
      * Backticks for method names and inline code.
      
      Also, converted a few long strings into the new heredoc convention.
      e595d91a
    • X
      let's warn with heredocs · b3bfa361
      Xavier Noria 提交于
      The current style for warning messages without newlines uses
      concatenation of string literals with manual trailing spaces
      where needed.
      
      Heredocs have better readability, and with `squish` we can still
      produce a single line.
      
      This is a similar use case to the one that motivated defining
      `strip_heredoc`, heredocs are super clean.
      b3bfa361
  10. 28 10月, 2014 1 次提交
  11. 26 10月, 2014 3 次提交
  12. 25 10月, 2014 3 次提交
  13. 17 10月, 2014 1 次提交
    • F
      Use include_blank value as option label · d611036c
      Frank Groeneveld 提交于
      Update select_tag to reflect documentation and behave the same as form builder select. If the value of include_blank is not boolean true, use that value as the option label.
      d611036c
  14. 16 10月, 2014 2 次提交
    • C
      Fix how file_ and password_field_tag edit options · dee00df1
      claudiob 提交于
      This commit fixes the behavior of `file_field_tag` and `password_field_tag`
      when invoked with a hash of options.
      
      These two helpers are different from all the other ones in that they modify the
      options hash passed as a parameter, whereas all the other helpers duplicate it
      before updating it.
      
      The result is that *bad things* can happen if the user re-uses the same hash.
      For instance, users who write the following code to display a file field
      followed by a text field (both with the same class):
      
      ```rhtml
      <% options = {class: 'important'} %>
      <%= file_field_tag 'Upload', options %>
      <%= text_field_tag 'Name', options %>
      ```
      
      would instead see **two file fields!**
      
      ```html
      <input class="important" id="Upload" name="Upload" type="file">
      <input class="important" id="Name" name="Name" type="file" value="value">
      ```
      
      This PR replaces `update` with `merge` in the code of the two helpers,
      fixing the issue above.
      
      The included test verifies the change, since it passes after this PR, but
      fails before with the following error:
      
      ```
      Expected: <input type="text" name="title" id="title" value="Hello!" class="important" />
      Actual: <input type="password" name="title" id="title" value="Hello!" class="important" />
      ```
      dee00df1
    • C
      Remove duplicate stringify_keys in text_field_tag · a9050e71
      claudiob 提交于
      All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
      and all the methods that invoke `number_field_tag` (that is `range_field_tag`)
      do not need to call `stringify_keys` on their `options` parameter since the
      `text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):
      
      ```ruby
      def text_field_tag(name, value = nil, options = {})
        tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
      end
      ```
      
      and `number_field_tag` is [already doing it internally](https://github.com/claudiob/rails/blob/e3207bdbba55f3806441f22b175557579bc0b051/actionview/lib/action_view/helpers/form_tag_helper.rb#L780) as well:
      
      ```ruby
      def number_field_tag(name, value = nil, options = {})
        options = options.stringify_keys
        ...
      end
      
      [Note #1: My code uses `merge` to respect the existing behavior of
      duplicating the `options` hash before updating its keys, see https://github.com/rails/rails/pull/17096#issuecomment-57223827]
      
      [Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
      forward to future version of Ruby/Raiks (GC symbols); the result of the method,
      however, is the same, because the symbols are stringified inside `text_field_tag`]
      
      [Note #3: I had previously created a similar PR #17096 but decided to
      split it into multiple PRs given the feedback received in the comments]
      a9050e71
  15. 13 10月, 2014 1 次提交
  16. 08 10月, 2014 1 次提交
    • S
      remove un-needed sort · 03d30ce7
      schneems 提交于
      HTML doesn't care what order the elements are rendered in, so why should we?
      
      Updates tests to use proper `assert_dom_equal` instead of `assert_equal` /cc @jeremy
      03d30ce7
  17. 03 10月, 2014 1 次提交
  18. 01 10月, 2014 1 次提交
  19. 30 9月, 2014 2 次提交
  20. 27 9月, 2014 2 次提交
  21. 26 9月, 2014 1 次提交
  22. 23 9月, 2014 1 次提交
  23. 22 9月, 2014 1 次提交
  24. 15 9月, 2014 2 次提交
  25. 14 9月, 2014 1 次提交
  26. 12 9月, 2014 1 次提交
  27. 11 9月, 2014 1 次提交
  28. 09 9月, 2014 1 次提交
  29. 06 9月, 2014 1 次提交
  30. 04 9月, 2014 1 次提交