Skip to content

Instantly share code, notes, and snippets.

@charliemaffitt
Created August 20, 2009 20:56
Show Gist options
  • Save charliemaffitt/171367 to your computer and use it in GitHub Desktop.
Save charliemaffitt/171367 to your computer and use it in GitHub Desktop.
<%- @homepage ? @home_or_int = 'home' : @home_or_int = 'int' -%>
<%- @homepage ? @int_or_nil = '' : @int_or_nil = '_int' -%>
<%- RAILS_ENV == 'production' ? @google_cse_id = '007606818108534743064:ed-nrsdhb4c' : @google_cse_id = '007606818108534743064:dppds1dran0' %>
<div id="<%= @home_or_int %>_search">
<form action="../default/searchresults" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="007606818108534743064:dppds1dran0" />
<input type="hidden" name="cof" value="FORID:9" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" class="<%= @home_or_int %>_search_field" />
<input type="submit" name="sa" value="" id="btn_search<%= @int_or_nil %>" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
<script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&amp;t13n_langs=en"></script>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>
</div> <!-- <%= @home_or_int %>_search -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment