Skip to content

Instantly share code, notes, and snippets.

View charliemaffitt's full-sized avatar

Charlie Maffitt charliemaffitt

View GitHub Profile
<% form_tag('http://campaignmonitorusername.cmail1.com/s/318810/') do %>
<p>
Email:<br />
<%= text_field_tag 'cm-318810-318810', params['cm-318810-318810'], :class => 'formfield' %>
<input type="submit" value="Sign Up" />
</p>
<% end %>
Task.find(:all, :include => [:projects, {:comments => :user}])
Task.find(:all, :include => [:projects, {:comments => :user}])
@folders = Folder.find(:all, :include => [:documents => {:groups => :users}], :conditions => "users.id = #{user.id}" )
var rand = Math.floor(Math.random()*index); // generate the random number
var rand2 = Math.floor(Math.random()*index); // generate the second random number
if (rand == rand2) {
var rand2 = Math.floor(Math.random()*index); // generate another random number
}
if (rand == rand2) {
var rand2 = Math.floor(Math.random()*index); // generate another random number (this raises the chance of duplicate entries to 1/64)
}
if (rand == rand2) {
var rand = Math.floor(Math.random()*index); // generate the random number
var rand2 = Math.floor(Math.random()*index); // generate the second random number
if (rand == rand2) {
var rand2 = Math.floor(Math.random()*index); // generate another random number
}
if (rand == rand2) {
var rand2 = Math.floor(Math.random()*index); // generate another random number (this raises the chance of duplicate entries to 1/64)
}
if (rand == rand2) {
<div id="dynamic_nav">
<ul>
<li><%= link_to session[:user] ? 'My Account' : 'Create An Account', session[:user] ? my_account_path : new_account_path %></li>
<li><%= link_to session[:user] ? 'Logout' : 'Login', session[:user] ? logout_path : login_path %></li>
</ul>
</div> <!-- end dynamic nav -->
<%- if @homepage -%>
<div id="home_search">
<!-- <div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1');
google.setOnLoadCallback(function(){
new google.search.CustomSearchControl('012346094628449066995:wpxldwrpz1g').draw('cse');
<%- @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" />
<!-- index.html.erb -->
<% form_tag search_path do %>
<%= select :search, :state, State.all.collect { |m| [m.full_name, m.id] }.sort, {:prompt=>'Please Select...'} %>
<%= observe_field(:state, :url => { :action => :update_city_menu },
:update => :city_field_div,
:with => :state
) %>
<div id="city_field_div"></div>
<%= submit_tag 'Submit' %>