Skip to content

Instantly share code, notes, and snippets.

View ascsystems's full-sized avatar

David ascsystems

View GitHub Profile
(function(Notification) {
var app = k12.app;
Notification.Model = Backbone.Model.extend({ });
Notification.Collection = Backbone.Collection.extend({
model: Notification.Model,
url: '/api/notifications',
parse: function(response) {
$this->source = $this->getServiceLocator()->get('notifications');
$group['keys'] = array('type' => 1);
$group['initial'] = array('notifications' => array());
$group['reduce'] = $reduce = "function (obj, prev) { prev.items.push(obj.name); }";
$query = $this->source->group($group['keys'], $group['initial'], $group['reduce'])->query()->sort('title');
Backbone.Layout.extend({
manage: true,
prefix: "/scripts/modules/templates/",
fetchTemplate: function(path) {
var done = this.async();
$.get(path + '.html', function(contents) {
done(contents);
});
},
<?php
class HomeController extends AbstractActionController
{
public function indexAction()
{
$tabs = $this->getServiceLocator()->get("tabs")->select();
$this->view->tabs = $tabs;
}
}
?>
<%= render partial: 'category_select', locals: { categories: Category.all } %>
_category_select.html.erb
<option value="<%= category_path(category) %>"><%= category.name %></option>
<div class="option_wrapper <%= if option_counter == 0
'first'
end %>">
<div class="option_header">SELECT <%= option.name %>: <span class="option_text"><%= option.option_values[0].name %></span></div>
<div class="options"><input type="hidden" name="options[<%= option_counter %>]" class="option_value" value="<%= option.option_values[0].id %>">
<%= render partial: option.option_type.template, collection: option.option_values %>
</div>
</div>
<%= image_tag "options/#{lid.display_data}", alt: lid.name, title: lid.name, class: 'lid option', option_id: lid.id %>
<a name="work_backwards"></a>
<form>
<fieldset>
<legend>Work Backwards</legend>
<p>Further instructions for part 5 can go here if necessary</p>
<div class="form-group">
<label for="bursts">Burst Length</label>
<input type="text" name="bursts" id="bursts">
</div>
<div class="form-group">
class ProductImage < ActiveRecord::Base
attr_accessible :name, :product_id, :path
belongs_to :product
has_many :product_option_value_images
has_many :product_option_values, through: :product_option_value_images
def getImage(options)
if(options.empty? == false)
image = ProductImage.joins(:product_option_values).where(product_option_values: { id: options })
activerecord (3.2.12) lib/active_record/attribute_methods/read.rb:72:in `__temp__'
activerecord (3.2.12) lib/active_record/base.rb:482:in `initialize'
app/controllers/user_stories_controller.rb:19:in `new'
app/controllers/user_stories_controller.rb:19:in `block in import'
/usr/local/rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/csv.rb:1792:in `each'
/usr/local/rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/csv.rb:1384:in `parse'
app/controllers/user_stories_controller.rb:15:in `import'
actionpack (3.2.12) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.12) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.12) lib/action_controller/metal/rendering.rb:10:in `process_action'