This file contains 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
<%= link_to "/tickets/#{@market.name.downcase}/ticket/#{category.slug}", nil, :class => "some class" do %> | |
HTML GARBAGE | |
<% end %> |
This file contains 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 InvoicesController < ApplicationController | |
def index | |
respond_with id InvoicesDecorator.new(invoices, InvoiceDecorator) | |
end | |
end | |
class InvoicesDecorator < Draper::DecoratedEnumerableProxy | |
def method_regardless_of_invoices_empty_or_not | |
"yay" |
This file contains 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
require 'csv' | |
module Exporter | |
DEFAULT_EXPORT_TABLES = [ Invoice, InvoiceItem, Item, Merchant, Transaction, User ] | |
DESTINATION_FOLDER = "tmp/" | |
def self.included(klass) | |
klass.extend ClassLevelMethods | |
end |
This file contains 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
def get_move(message) | |
puts message | |
prompt # What does this method do? | |
gets.chomp.downcase | |
end | |
def department_stores | |
message = "You kept walking ahead. There are two department stores in front of you." + | |
"Do you want to go to WALMART or Nordstroms?" | |
while true |
This file contains 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
require "rubygems" | |
require "fastercsv" | |
class SalAttend | |
attr_accessor :file | |
attr_accessor :headers | |
# Added the parameter here... | |
def initialize(filename) | |
puts "JSAttend Initialized" |
This file contains 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
<h1><%= pluralize @articles.count, "Article" %></h1> | |
<%= link_to "Add", new_article_path, :class => "new_article" %> | |
<ul id="articles"> | |
<% @articles.each do |article| %> | |
<li><%= link_to article.title, article_path(article) %></li> | |
<% end %> | |
</ul> |
This file contains 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
begin | |
beer = 3 | |
while beer > 1 | |
# Repeat what's in here as long as it's TRUE that the counter is greater than zero | |
puts "#{beer} bottles of beer on the wall, #{beer} bottles of beer! Take one down and pass it around," | |
beer = beer - 1 | |
if beer > 1 | |
puts "#{beer} bottles of beer on the wall." | |
else | |
puts "#{beer} bottle of beer on the wall." |
This file contains 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
line_width = 25 | |
begin | |
puts 'Table of Contents'.center(line_width) | |
puts 'Chapter 1: Intro'.ljust(line_width) + 'page 1'.rjust(line_width) | |
puts 'Chapter 2: Numbers'.ljust(line_width) + 'page 9'.rjust(line_width) | |
puts 'Chapter 3: Letters'.ljust(line_width) + 'page 13'.rjust(line_width) | |
end |
This file contains 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
require 'rubygems' | |
require 'jumpstart_auth' | |
class JSTwitter | |
attr_reader :client | |
def initialize | |
puts "Initializing" | |
@client = JumpstartAuth.twitter | |
end |
This file contains 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
require 'rubygems' | |
require 'jumpstart_auth' | |
class JSTwitter | |
attr_reader :client | |
def initialize | |
puts "Initializing" | |
@client = JumpstartAuth.twitter | |
end |
NewerOlder