Skip to content

Instantly share code, notes, and snippets.

@TXDynamics
TXDynamics / admin-console-form-default.rb
Created July 7, 2013 21:46
Admin Console Form Default
<%= simple_form_for(@question_category) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name, input_html: { class: 'span7' }, label: 'Category Name' %>
<div class="form-actions">
<%= f.button :submit , :class => 'btn medium btn-primary', value: 'Post It!' %>
</div>
</div>
<% end %>
@TXDynamics
TXDynamics / admin-base-page.rb
Created July 7, 2013 21:18
Admin Base Page
<% provide(:page_title, "Editing #{@question_category.name}") %>
<% provide(:page_heading, "Editing #{@question_category.name}" ) %>
<% provide(:page_heading_sub, 'Manage the attributes of this category') %>
<article class="span12 sortable-grid ui-sortable">
<!-- new widget -->
<div class="jarviswidget jarviswidget-sortable" id="widget-id-1" role="widget">
<header role="heading">
<h2>Animated bars</h2>
@TXDynamics
TXDynamics / default-simple_form-layout.rb
Created July 7, 2013 21:11
Base Simple_form form rails layout
<%= simple_form_for(@listing) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :listing_title, hint: '<strong>Pick a descriptive title to really sell your place!</strong>', input_html: { class: 'span7' }, label: 'Listing Title' %>
<%= f.input :listing_description, as: :text, input_html: { class: 'span7' } %>
<%= f.input :listing_roomate_count, collection: 1..5, label: 'How Many Roomates?', prompt: 'Choose' %>
<!-- This is a default value of USA and can be switched later when expanding more countries -->
<%= f.hidden_field :country_id, value: '236' %>
<%= f.input :state_id, collection: @states, label_method: :name, value_method: :id, prompt: 'State' %>
@TXDynamics
TXDynamics / nurumie-admin-console-table-default.rb
Created July 6, 2013 21:44
Nurumie Admin Console Table Default
<div class="row-fluid">
<article class="span10">
<!-- new widget -->
<div class="jarviswidget" id="widget-id-4">
<header>
<h2>Title</h2>
</header>
<!-- wrap div -->
<div>
@TXDynamics
TXDynamics / admin-console-titles.rb
Created July 4, 2013 20:27
Nurumie Admin-Console Titles
<% provide(:page_title, "Title") %>
<% provide(:page_heading, "Heading" ) %>
<% provide(:page_heading_sub, 'Sub description') %>
@TXDynamics
TXDynamics / nurumie-section-headers.rb
Created July 3, 2013 21:20
Nurumie Section Headers
<div class='row-fluid' style='background-color: rgb(124,187,0); color:white;'>
<h2 style='margin-left: 10px;margin-bottom: 4px;'>Listing Description <span class="label label-primary">Public</span></h2>
<p style="margin-left: 10px;">
Describe your listing so others would want to live there! The more details the better.
This part of your listing is public and can be seen by everyone. It is also indexed by search engines.
</p>
</div>
@TXDynamics
TXDynamics / ruby-nurumie-titles
Created July 3, 2013 20:27
Nurumie Website Title Template
<% provide(:page_title, "Roommate Friendly Rental Listings") %>
<% provide(:page_heading, "Roommate Friendly Rental Listings" ) %>
<% provide(:page_heading_sub, 'Take a look at the listings available and manage the ones you have posted.') %>
@TXDynamics
TXDynamics / simple_form_boot-strap_quick_reference.rb
Created June 15, 2013 13:15
Simple_form Quick Reference Bootstrap Views
# standard input with with defined by span and a stylized hint and defined Lable
<%= f.input :listing_title, hint: '<strong>Pick a descriptive title to really sell your place!</strong>', input_html: { class: 'span7' }, label: 'Listing Title' %>
# Standard Input complete defaults pulled from the associated model
<%= f.input :listing_title %>
# Submit Button with modified bootstrap style and Text
<%= f.button :submit , :class => 'btn btn-medium btn-success', value: 'Post It!' %>
# Dynamic Dropdown Select Box using values from a model
@TXDynamics
TXDynamics / kaminari-bootstrap.rb
Created June 12, 2013 01:54
Kaminari Pagination Bootstrap views install
rails generate kaminari:views bootstrap
@TXDynamics
TXDynamics / rails-scaffold-existing-model
Created June 10, 2013 21:30
Ruby Rails: Create Scaffold from Existing Model
rails g scaffold_controller Model