This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json.data do | |
json.partial! "board/items/item", locals: { item: @item } | |
end | |
json.meta do | |
json.receipt @receipt if @receipt.present? | |
json.genesis_address @item.genesis_address | |
json.short_address @item.short_address | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "hash" | |
def pretty_name(string) | |
return "election" if string.to_s == "genesis_item" | |
string.to_s.gsub("_configuration_item", "") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
370-230174-230174 | |
370-230174-230174-40 | |
370-230174-230174-41 | |
370-230174-230174-42 | |
370-230174-230174-43 | |
370-230174-230174-45 | |
370-230174-230174-46 | |
370-230174-230174-47 | |
370-230174-230174-48 | |
370-230176-230176 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" /> | |
</head> | |
<body style="background-color: #fff;"> | |
<p>Current style:</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uid | |
1 | |
2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shared_examples :denied_access do | |
before{ action } | |
it { request.should redirect_to sign_in_path } | |
it { response.status.should eq 302 } | |
end | |
shared_examples :response_ok do | |
before{ action } | |
it { response.should be_success } | |
it { response.status.should eq 200 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will fill out the form defined in the `form` hash, and it will fill the | |
# form elements with the data from the `atrs` hash. So you need to define both | |
# before incuding this context. | |
# | |
# The smallest, possible example: | |
# | |
# include_context :fill_and_submit_form do | |
# let(:form){ {id: "new_user_form" } } | |
# let(:atrs) { {name: "Weeble & Bob"} } | |
# end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
def compact | |
self.select{|k,v| !v.blank? } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# In order to expose the `where` and `query` methods (see query.js) we extend | |
# from the QueryCollection class instead of the standard backbone collection. | |
# | |
class Backbone.StandardCollection extends Backbone.QueryCollection | |
# Checks that the csrf token is present, otherwise fetch it. | |
csrfToken: -> | |
if $("head meta[name='csrf-token']").length > 0 | |
debug.log "CSRF token present." | |
return true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Date | |
# Samples a random time | |
# | |
# Parameters | |
# This takes up to three parameters, that is a range of `years`, `months` and | |
# `days`. Each defining the boundries of the sample date. | |
# | |
# Examples | |
# `Time.random({ years: 1..2 })` will produce a date between one and two |
NewerOlder