Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

713 lines (465 sloc) 30.994 kB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Module: RenderConstraintsHelper</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
relpath = '';
if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8">
if (window.top.frames.main) document.body.className = 'frames';
</script>
<div id="header">
<div id="menu">
<a href="_index.html">Index (R)</a> &raquo;
<span class="title">RenderConstraintsHelper</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a id="class_list_link" href="#">Class List</a>
<a id="method_list_link" href="#">Method List</a>
<a id ="file_list_link" href="#">File List</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Module: RenderConstraintsHelper
</h1>
<dl class="box">
<dt class="r1">Included in:</dt>
<dd class="r1"><span class='object_link'><a href="ApplicationHelper.html" title="ApplicationHelper (module)">ApplicationHelper</a></span></dd>
<dt class="r2 last">Defined in:</dt>
<dd class="r2 last">vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>
All methods in here are &#8216;api&#8217; that may be over-ridden by
plugins and local code, so method signatures and semantics should not be
changed casually. implementations can be of course.
</p>
<p>
Includes methods for rendering contraints graphically on the search results
page (render_constraints(_*)), and also for rendering more textually on
Search History page (render_search_to_s(_*))
</p>
</div>
</div>
<div class="tags">
</div>
<h2>
Instance Method Summary
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#render_constraint_element-instance_method" title="#render_constraint_element (instance method)">- (Object) <strong>render_constraint_element</strong>(label, value, options = {}) </a>
</span>
<span class="summary_desc"><div class='inline'><p>
Render a label/value constraint on the screen.
</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render_constraints-instance_method" title="#render_constraints (instance method)">- (Object) <strong>render_constraints</strong>(localized_params = params) </a>
</span>
<span class="summary_desc"><div class='inline'><p>
Render actual constraints, not including header or footer info.
</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render_constraints_filters-instance_method" title="#render_constraints_filters (instance method)">- (Object) <strong>render_constraints_filters</strong>(localized_params = params) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render_constraints_query-instance_method" title="#render_constraints_query (instance method)">- (Object) <strong>render_constraints_query</strong>(localized_params = params) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render_search_to_s-instance_method" title="#render_search_to_s (instance method)">- (Object) <strong>render_search_to_s</strong>(params) </a>
</span>
<span class="summary_desc"><div class='inline'><p>
Simpler textual version of constraints, used on Search History page.
</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render_search_to_s_element-instance_method" title="#render_search_to_s_element (instance method)">- (Object) <strong>render_search_to_s_element</strong>(key, value, options = {}) </a>
</span>
<span class="summary_desc"><div class='inline'><p>
value can be Array, in which case elements are joined with
&#8216;and&#8217;.
</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render_search_to_s_filters-instance_method" title="#render_search_to_s_filters (instance method)">- (Object) <strong>render_search_to_s_filters</strong>(params) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render_search_to_s_q-instance_method" title="#render_search_to_s_q (instance method)">- (Object) <strong>render_search_to_s_q</strong>(params) </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
</ul>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<p class="signature first" id="render_constraint_element-instance_method">
- (<tt>Object</tt>) <strong>render_constraint_element</strong>(label, value, options = {})
</p><div class="docstring">
<div class="discussion">
<p>
Render a label/value constraint on the screen. Can be called by plugins and
such to get application-defined rendering.
</p>
<p>
Can be over-ridden locally to render differently if desired, although in
most cases you can just change CSS instead.
</p>
<p>
Can pass in nil label if desired.
</p>
<p>
options:
</p>
<dl>
<dt>:remove</dt><dd><p>
url to execute for a &#8216;remove&#8217; action
</p>
</dd>
<dt>:classes</dt><dd><p>
can be an array of classes to add to container span for constraint.
</p>
</dd>
<dt>:escape_label</dt><dd><p>
default true, HTML escape.
</p>
</dd>
<dt>:escape_value</dt><dd><p>
default true, HTML escape.
</p>
</dd>
</dl>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
69
70
71</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 69</span>
<span class='def def kw'>def</span> <span class='render_constraint_element identifier id'>render_constraint_element</span><span class='lparen token'>(</span><span class='label identifier id'>label</span><span class='comma token'>,</span> <span class='value identifier id'>value</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
<span class='render identifier id'>render</span><span class='lparen token'>(</span><span class='symbol val'>:partial</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;catalog/constraints_element&quot;</span><span class='comma token'>,</span> <span class='symbol val'>:locals</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrace token'>{</span><span class='symbol val'>:label</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='label identifier id'>label</span><span class='comma token'>,</span> <span class='symbol val'>:value</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='value identifier id'>value</span><span class='comma token'>,</span> <span class='symbol val'>:options</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='options identifier id'>options</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="render_constraints-instance_method">
- (<tt>Object</tt>) <strong>render_constraints</strong>(localized_params = params)
</p><div class="docstring">
<div class="discussion">
<p>
Render actual constraints, not including header or footer info.
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
13
14
15</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 13</span>
<span class='def def kw'>def</span> <span class='render_constraints identifier id'>render_constraints</span><span class='lparen token'>(</span><span class='localized_params identifier id'>localized_params</span> <span class='assign token'>=</span> <span class='params identifier id'>params</span><span class='rparen token'>)</span>
<span class='render_constraints_query identifier id'>render_constraints_query</span><span class='lparen token'>(</span><span class='localized_params identifier id'>localized_params</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='render_constraints_filters identifier id'>render_constraints_filters</span><span class='lparen token'>(</span><span class='localized_params identifier id'>localized_params</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="render_constraints_filters-instance_method">
- (<tt>Object</tt>) <strong>render_constraints_filters</strong>(localized_params = params)
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 36</span>
<span class='def def kw'>def</span> <span class='render_constraints_filters identifier id'>render_constraints_filters</span><span class='lparen token'>(</span><span class='localized_params identifier id'>localized_params</span> <span class='assign token'>=</span> <span class='params identifier id'>params</span><span class='rparen token'>)</span>
<span class='return return kw'>return</span> <span class='string val'>&quot;&quot;</span> <span class='unless unless_mod kw'>unless</span> <span class='localized_params identifier id'>localized_params</span><span class='lbrack token'>[</span><span class='symbol val'>:f</span><span class='rbrack token'>]</span>
<span class='content identifier id'>content</span> <span class='assign token'>=</span> <span class='string val'>&quot;&quot;</span>
<span class='localized_params identifier id'>localized_params</span><span class='lbrack token'>[</span><span class='symbol val'>:f</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='each_pair identifier id'>each_pair</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='facet identifier id'>facet</span><span class='comma token'>,</span><span class='values identifier id'>values</span><span class='bitor op'>|</span>
<span class='values identifier id'>values</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='val identifier id'>val</span><span class='bitor op'>|</span>
<span class='content identifier id'>content</span> <span class='lshft op'>&lt;&lt;</span> <span class='render_constraint_element identifier id'>render_constraint_element</span><span class='lparen token'>(</span> <span class='facet_field_labels identifier id'>facet_field_labels</span><span class='lbrack token'>[</span><span class='facet identifier id'>facet</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
<span class='val identifier id'>val</span><span class='comma token'>,</span>
<span class='symbol val'>:remove</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='catalog_index_path identifier id'>catalog_index_path</span><span class='lparen token'>(</span><span class='remove_facet_params identifier id'>remove_facet_params</span><span class='lparen token'>(</span><span class='facet identifier id'>facet</span><span class='comma token'>,</span> <span class='val identifier id'>val</span><span class='comma token'>,</span> <span class='localized_params identifier id'>localized_params</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='comma token'>,</span>
<span class='symbol val'>:classes</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;filter&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;filter-&quot;</span> <span class='plus op'>+</span> <span class='facet identifier id'>facet</span><span class='dot token'>.</span><span class='parameterize identifier id'>parameterize</span><span class='rbrack token'>]</span>
<span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='string val'>&quot;\n&quot;</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
<span class='return return kw'>return</span> <span class='content identifier id'>content</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="render_constraints_query-instance_method">
- (<tt>Object</tt>) <strong>render_constraints_query</strong>(localized_params = params)
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 17</span>
<span class='def def kw'>def</span> <span class='render_constraints_query identifier id'>render_constraints_query</span><span class='lparen token'>(</span><span class='localized_params identifier id'>localized_params</span> <span class='assign token'>=</span> <span class='params identifier id'>params</span><span class='rparen token'>)</span>
<span class='comment val'># So simple don't need a view template, we can just do it here.</span>
<span class='if if kw'>if</span> <span class='lparen token'>(</span><span class='notop op'>!</span><span class='localized_params identifier id'>localized_params</span><span class='lbrack token'>[</span><span class='symbol val'>:q</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='blank? fid id'>blank?</span><span class='rparen token'>)</span>
<span class='label identifier id'>label</span> <span class='assign token'>=</span>
<span class='if if kw'>if</span> <span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:search_field</span><span class='rbrack token'>]</span> <span class='eq op'>==</span> <span class='Blacklight constant id'>Blacklight</span><span class='dot token'>.</span><span class='default_search_field identifier id'>default_search_field</span><span class='lbrack token'>[</span><span class='symbol val'>:key</span><span class='rbrack token'>]</span> <span class='or or kw'>or</span> <span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:search_field</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='blank? fid id'>blank?</span> <span class='rparen token'>)</span>
<span class='nil nil kw'>nil</span>
<span class='else else kw'>else</span>
<span class='Blacklight constant id'>Blacklight</span><span class='dot token'>.</span><span class='label_for_search_field identifier id'>label_for_search_field</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:search_field</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
<span class='render_constraint_element identifier id'>render_constraint_element</span><span class='lparen token'>(</span><span class='label identifier id'>label</span><span class='comma token'>,</span>
<span class='localized_params identifier id'>localized_params</span><span class='lbrack token'>[</span><span class='symbol val'>:q</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
<span class='symbol val'>:classes</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;query&quot;</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
<span class='symbol val'>:remove</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='catalog_index_path identifier id'>catalog_index_path</span><span class='lparen token'>(</span><span class='localized_params identifier id'>localized_params</span><span class='dot token'>.</span><span class='merge identifier id'>merge</span><span class='lparen token'>(</span><span class='symbol val'>:q=</span><span class='gt op'>&gt;</span><span class='nil nil kw'>nil</span><span class='comma token'>,</span> <span class='symbol val'>:action=</span><span class='gt op'>&gt;</span><span class='string val'>'index'</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
<span class='else else kw'>else</span>
<span class='string val'>&quot;&quot;</span>
<span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="render_search_to_s-instance_method">
- (<tt>Object</tt>) <strong>render_search_to_s</strong>(params)
</p><div class="docstring">
<div class="discussion">
<p>
Simpler textual version of constraints, used on Search History page.
Theoretically can may be DRY&#8217;d up with results page
render_constraints, maybe even using the very same HTML with different CSS?
But too tricky for now, too many changes to existing CSS. TODO.
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
78
79
80
81</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 78</span>
<span class='def def kw'>def</span> <span class='render_search_to_s identifier id'>render_search_to_s</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='rparen token'>)</span>
<span class='render_search_to_s_q identifier id'>render_search_to_s_q</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='rparen token'>)</span> <span class='plus op'>+</span>
<span class='render_search_to_s_filters identifier id'>render_search_to_s_filters</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="render_search_to_s_element-instance_method">
- (<tt>Object</tt>) <strong>render_search_to_s_element</strong>(key, value, options = {})
</p><div class="docstring">
<div class="discussion">
<p>
value can be Array, in which case elements are joined with
&#8216;and&#8217;. Pass in option :escape_value => false to pass in
pre-rendered html for value. key with escape_key if needed.
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
108
109
110
111
112
113
114
115
116
117
118</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 108</span>
<span class='def def kw'>def</span> <span class='render_search_to_s_element identifier id'>render_search_to_s_element</span><span class='lparen token'>(</span><span class='key identifier id'>key</span><span class='comma token'>,</span> <span class='value identifier id'>value</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
<span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:escape_value</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='true true kw'>true</span> <span class='unless unless_mod kw'>unless</span> <span class='options identifier id'>options</span><span class='dot token'>.</span><span class='has_key? fid id'>has_key?</span><span class='lparen token'>(</span><span class='symbol val'>:escape_value</span><span class='rparen token'>)</span>
<span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:escape_key</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='true true kw'>true</span> <span class='unless unless_mod kw'>unless</span> <span class='options identifier id'>options</span><span class='dot token'>.</span><span class='has_key? fid id'>has_key?</span><span class='lparen token'>(</span><span class='symbol val'>:escape_key</span><span class='rparen token'>)</span>
<span class='key identifier id'>key</span> <span class='assign token'>=</span> <span class='h identifier id'>h</span><span class='lparen token'>(</span><span class='key identifier id'>key</span><span class='rparen token'>)</span> <span class='if if_mod kw'>if</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:escape_key</span><span class='rbrack token'>]</span>
<span class='value identifier id'>value</span> <span class='assign token'>=</span> <span class='h identifier id'>h</span><span class='lparen token'>(</span><span class='value identifier id'>value</span><span class='rparen token'>)</span> <span class='if if_mod kw'>if</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:escape_value</span><span class='rbrack token'>]</span>
<span class='string val'>&quot;&lt;span class='constraint'&gt;&quot;</span> <span class='plus op'>+</span>
<span class='lparen token'>(</span><span class='key identifier id'>key</span><span class='dot token'>.</span><span class='blank? fid id'>blank?</span> <span class='integer val'>? </span><span class='string val'>&quot;&quot;</span> <span class='colon op'>:</span> <span class='dstring node'>&quot;&lt;span class='filterName'&gt;#{key}:&lt;/span&gt;&quot;</span><span class='rparen token'>)</span> <span class='plus op'>+</span>
<span class='dstring node'>&quot;&lt;span class='filterValue'&gt;#{value}&lt;/span&gt;&lt;/span&gt;&quot;</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="render_search_to_s_filters-instance_method">
- (<tt>Object</tt>) <strong>render_search_to_s_filters</strong>(params)
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
92
93
94
95
96
97
98
99
100
101
102
103</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 92</span>
<span class='def def kw'>def</span> <span class='render_search_to_s_filters identifier id'>render_search_to_s_filters</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='rparen token'>)</span>
<span class='return return kw'>return</span> <span class='string val'>&quot;&quot;</span> <span class='unless unless_mod kw'>unless</span> <span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:f</span><span class='rbrack token'>]</span>
<span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:f</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='collect identifier id'>collect</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='facet_field identifier id'>facet_field</span><span class='comma token'>,</span> <span class='value_list identifier id'>value_list</span><span class='bitor op'>|</span>
<span class='render_search_to_s_element identifier id'>render_search_to_s_element</span><span class='lparen token'>(</span><span class='Blacklight constant id'>Blacklight</span><span class='dot token'>.</span><span class='config identifier id'>config</span><span class='lbrack token'>[</span><span class='symbol val'>:facet</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:labels</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='facet_field identifier id'>facet_field</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
<span class='value_list identifier id'>value_list</span><span class='dot token'>.</span><span class='collect identifier id'>collect</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='value identifier id'>value</span><span class='bitor op'>|</span>
<span class='dstring node'>&quot;&lt;span class='filterValue'&gt;#{h(value)}&lt;/span&gt;&quot;</span>
<span class='end end kw'>end</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>&quot; &lt;span class='label'&gt;and&lt;/span&gt; &quot;</span><span class='rparen token'>)</span><span class='comma token'>,</span>
<span class='symbol val'>:escape_value</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='false false kw'>false</span>
<span class='rparen token'>)</span>
<span class='end end kw'>end</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>&quot; \n &quot;</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="render_search_to_s_q-instance_method">
- (<tt>Object</tt>) <strong>render_search_to_s_q</strong>(params)
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
83
84
85
86
87
88
89
90
91</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'vendor/plugins/blacklight/app/helpers/render_constraints_helper.rb', line 83</span>
<span class='def def kw'>def</span> <span class='render_search_to_s_q identifier id'>render_search_to_s_q</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='rparen token'>)</span>
<span class='return return kw'>return</span> <span class='string val'>&quot;&quot;</span> <span class='if if_mod kw'>if</span> <span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:q</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='blank? fid id'>blank?</span>
<span class='label identifier id'>label</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:search_field</span><span class='rbrack token'>]</span> <span class='eq op'>==</span> <span class='Blacklight constant id'>Blacklight</span><span class='dot token'>.</span><span class='default_search_field identifier id'>default_search_field</span><span class='lbrack token'>[</span><span class='symbol val'>:key</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='question op'>?</span>
<span class='nil nil kw'>nil</span> <span class='colon op'>:</span>
<span class='Blacklight constant id'>Blacklight</span><span class='dot token'>.</span><span class='label_for_search_field identifier id'>label_for_search_field</span><span class='lparen token'>(</span><span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:search_field</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
<span class='render_search_to_s_element identifier id'>render_search_to_s_element</span><span class='lparen token'>(</span><span class='label identifier id'>label</span> <span class='comma token'>,</span> <span class='params identifier id'>params</span><span class='lbrack token'>[</span><span class='symbol val'>:q</span><span class='rbrack token'>]</span> <span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Jan 17 21:46:32 2011 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.6.4 (ruby-1.8.7).
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.