Skip to content

Instantly share code, notes, and snippets.

@TXDynamics
TXDynamics / form.html.erb
Created October 5, 2013 00:36
This is the standard for layout for the TriStateCEO template rails application
<h3 class="post-title">Input Form Title</h3>
<div class="contact-form cleafix">
<!-- Simple_Form For Open Inserted Below-->
<div class="form-inputs">
<!-- Simple_Form for inputs put below -->
</div>
<!-- Simple_Form formatted Submit Button Placed Below -->
@TXDynamics
TXDynamics / rails-server-production-mode.rb
Created September 15, 2013 17:17
Launch / Run Rails Server in Production Mode
rails server -e production
@TXDynamics
TXDynamics / default-tristateceo-page.rb
Created September 3, 2013 18:50
Default TristateCEO page
<% provide(:page_title, 'Open Funds') %>
@TXDynamics
TXDynamics / abase-research-views-titles.html.erb
Created August 13, 2013 15:27
Abase Research standard html components <title> clas="head", and class="subhead"
<% provide(:page_title, 'Open Funds') %>
<% provide(:page_heading, 'Open Funds') %>
<% provide(:page_heading_sub, 'Funds with open investment status.') %>
@TXDynamics
TXDynamics / kaminari-controller-pagination-code.rb
Created August 13, 2013 14:57
Controller Code for the Kaminari pagination gem
# In this example we are populating the index method with all records
# you do not use the all method when combining with the page method of kaminari
@funds = ProductCache.page(params[:page]).per(50)
@TXDynamics
TXDynamics / abase-research-application-index.html.erb
Created August 13, 2013 14:44
Default index page for the Abase application
<% provide(:page_title, 'Open Funds') %>
<% provide(:page_heading, 'Open Funds') %>
<% provide(:page_heading_sub, 'Funds with open investment status.') %>
<div class="row-fluid">
<div class="span12">
<div class="table-header">
<!--[TODO] There must be a better way to do this-->
<strong><%= @funds.size %></strong> Funds with OPEN status in ABase"
</div>
<table id="table_bug_report" class="table table-striped table-bordered table-hover">
@TXDynamics
TXDynamics / get_domain_from_url.rb
Created August 12, 2013 19:40
Rails helper that extracts the domain from a URL submitted to the function.
# Use this helping to display the base domain name of a url
# I am using it when displaying web results that are loaded from Social Search
def get_host_without_www(url)
require 'uri'
uri = URI.parse(url)
uri = URI.parse("http://#{url}") if uri.scheme.nil?
host = uri.host.downcase
host.start_with?('www.') ? host[4..-1] : host
end
@TXDynamics
TXDynamics / git-clone-remote-branch.txt
Created July 17, 2013 14:05
Git Clone specific remote branch
git checkout -b experimental origin/experimental
@TXDynamics
TXDynamics / rails-delete-as-image.rb
Created July 12, 2013 13:33
Set Destroy / Delete link in Rails to an Image or other html
<%= link_to '<i class=" cus-cancel"></i> Delete'.html_safe, questionnaire_path(@questionnaire), method: :delete, data: {confirm: 'Are you sure?'} %>
@TXDynamics
TXDynamics / abase-default-table-style.rb
Created July 9, 2013 17:22
Abase Default Table Style
<div class="row-fluid">
<div class="span12">
<table id="table_bug_report" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Account Name</th>
<th>Contact Name</th>
<th>Contact Email</th>
<th></th>
</tr>