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 ArticleFormBuilder < ExtensibleFormBuilder | |
| after(:article, :author_id) do |f| | |
| f.field_set do | |
| <<-html | |
| #{ f.text_field(:teaser_title, :label => true) } | |
| #{ f.text_field(:teaser_subtitle, :label => true) } | |
| #{ f.text_field(:teaser_image_url, :label => true) } | |
| #{ f.text_area(:teaser_text, :label => true, :class => 'short') } | |
| html | |
| 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
| require 'rubygems' | |
| require 'activesupport' | |
| module ActionController | |
| end | |
| class ActionController::Base | |
| end | |
| module ActionController::Helpers |
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
| local:~/ clemens$ sudo jgem install rspec --no-ri --no-rdoc | |
| /opt/local/jruby/bin/jgem: line 8: require: command not found | |
| /opt/local/jruby/bin/jgem: line 9: require: command not found | |
| /opt/local/jruby/bin/jgem: line 10: require: command not found | |
| /opt/local/jruby/bin/jgem: line 12: required_version: command not found | |
| /opt/local/jruby/bin/jgem: line 14: unless: command not found | |
| /opt/local/jruby/bin/jgem: line 15: abort: command not found | |
| /opt/local/jruby/bin/jgem: line 16: end: command not found | |
| /opt/local/jruby/bin/jgem: line 18: args: command not found | |
| /opt/local/jruby/bin/jgem: line 20: begin: command not found |
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
| # Ruby on Rails Developer, Berlin/Potsdam | |
| describe "Job: Ruby on Rails Developer(m/f)" do | |
| before do | |
| we = Company.new( | |
| :name => 'adva Business Software GmbH', | |
| :website => 'http://adva-business.com', | |
| :email => 'info@adva-business.com' | |
| ) | |
| you = Developer.new | |
| job = Job.new(we, you, :title => "Ruby on Rails Developer", :location => "Berlin/Potsdam") |
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
| Object.class_eval do | |
| def fucking | |
| self | |
| end | |
| end | |
| 20.fucking.minutes.from_now |
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
| # Domtastic Cucumber | |
| # | |
| # domesticate your Cucumber | |
| # | |
| # written by Clemens Kofler <clemens@railway.at> | |
| # http://www.railway.at | |
| # http://github.com/clemens | |
| # | |
| # see http://www.railway.at/articles/2009/09/12/using-cucumber-to-test-a-multilingual-app | |
| # for reasons why this might be what you need ;-) |
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
| # no need to override human_attribute_name to customize error messages ... | |
| # http://wgibbs.github.com/2009/10/27/human-attribute-name.html | |
| en: | |
| activerecord: | |
| attributes: | |
| user: | |
| permissions: 'Reuse settings' |
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
| +------+--------+------------------------+------------+ | |
| | City | People | Spending power (total) | Sold units | | |
| +------+--------+------------------------+------------+ | |
| | A | 10 | 200,000 | 30 | | |
| | B | 5 | 150,000 | 25 | | |
| | C | 5 | 50,000 | 20 | | |
| | D | 25 | 400,000 | 35 | | |
| +------+--------+------------------------+------------+ | |
| To do: |
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 Post < ActiveRecord::Base | |
| scope :published, where(:published => true) | |
| scope :published, :conditions => { :published => true } | |
| end | |
| # the first one fails when loading the environment (e.g. when migrating the database), if the posts table doesn't exist | |
| # the second one (always) works, independent of whether or not the table exists | |
| # ... or so it seems ... |
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
| ################################### | |
| # I'm a pretty comment with style # | |
| ################################### |