Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>*args</code> just means that you can pass unlimited number of arguments. So this method needs 2 arguments first (builder &amp; attribute) and then you could pass any number of args after that. Here is a description of what is going on in the method relating to the args:</p> <ol> <li><p>If the third argument passed to this method is not a hash, then it sets that arg as the name and removes it (<code>args.shift</code>), otherwise use the builder name. </p></li> <li><p>Then it looks at the next arg (which would be the 4th). If its a hash, then it sets options to that arg and deletes that arg, otherwise it sets it to empty hash. </p></li> <li><p>Then it looks at the next arg (5th arg). If its a hash, then it sets that as html_options and deletes that arg, otherwise html is set to {}.</p></li> </ol> <p>Using args* can make calling the method a little cleaner (although the implementation in the method might not be). If you did not have a "name" to pass, instead of doing this:</p> <pre><code>sort_link(some_builder,some_attribute,nil,options) </code></pre> <p>you can do this:</p> <pre><code>sort_link(some_builder,some_attribute,options) </code></pre> <p>It does not force you to add a arg for name, if you don't have one.</p> <p>So for your code to work, this method would need to take options as the 4th arg, and the options hash would need to contain <code>:sort_preferences</code>. What does the code look like that is calling <code>sort_link</code>? You need to insert this option into that hash before it gets to this method.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload