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
$('.images').append('<%= escape_javascript(render(:partial => "image", :object => @image)) %>'); | |
$('#<%= dom_id(@image) %> span').rest_in_place('<%= image_path(@image) %>', 'image', 'title'); | |
if ($('#images').css('display') == 'none') { | |
$('#images').slideDown(1000); | |
} |
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' | |
IRB.conf[:AUTO_INDENT] = false | |
IRB.conf[:USE_READLINE] = true | |
class Object | |
# easy way to list an object's methods without clutter | |
def local_methods | |
(methods - Object.instance_methods).sort | |
end | |
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' | |
#doesn't work as expected. conflicts with utility belt | |
if ENV.include?('RAILS_ENV') | |
if !Object.const_defined?('RAILS_DEFAULT_LOGGER') | |
require 'logger' | |
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT)) | |
end | |
require 'hirb' |
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' | |
puts "testing' |
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
<% | |
allowed_extensions = [:jpg, :jpeg] | |
max_size = 10.megabyte | |
allow_multiple_files = true | |
button_label = t('uploadify.choose') | |
url = url_for(:slideshow_id => slideshow, :action => :create, :controller => :slides) | |
%> | |
<%- session_key_name = ActionController::Base.session_options[:key] -%> | |
<% content_for :header do -%> | |
<%= javascript_include_tag "swfobject" %> |
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 ShippingOption # Base class | |
@children = [] | |
def self.inherited(child) | |
@children << child | |
end | |
def self.shipping_options(weight, international) | |
@children.select {|child| child.can_ship?(weight, international)} | |
end | |
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 One | |
def self.inherited(by) | |
by.instance_eval do | |
class << self | |
define_method(:test) do | |
puts "it works from #{self}" | |
end | |
end | |
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
# | |
# Copyright 2000-2009 JetBrains s.r.o. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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
raise Exception.new | |
#oder | |
raise Exception.new("hallo") | |
#oder auch eigene Exceptions implementieren | |
class MyTinyException < StandardError | |
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
<h1>Your Pragmatic Catalog </h1> | |
<% @products.each do |product| %> | |
<div class="entry"> | |
<%= link_to image_tag(product.image_url) , line_items_path(:product_id => product.id) , | |
:method => :post %> | |
<h3><%= product.title %></h3> | |
<%=raw product.description %> |
OlderNewer