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
You have a nil object when you didn't expect it! | |
You might have expected an instance of ActiveRecord::Base. | |
The error occurred while evaluating nil.[] (NoMethodError) | |
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/console.rb:132:in `print_tag_limit_warnings' | |
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/console.rb:130:in `each' | |
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/console.rb:130:in `print_tag_limit_warnings' | |
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/pretty.rb:232:in `print_summary' | |
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/pretty.rb:27:in `after_features' | |
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:170:in `__send__' | |
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:170:in `send_to_all' |
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
title = "abc" | |
[1,2].each do |p| | |
puts title | |
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
+----+-------------+-------------+-------------------+-------------------+-----------------+----------+ | |
| id | component_a | component_b | component_a_model | component_b_model | connection_type | position | | |
+----+-------------+-------------+-------------------+-------------------+-----------------+----------+ | |
| 19 | 7 | 3 | 1 | 2 | 1 | NULL | | |
| 20 | 3 | 7 | 2 | 1 | 1 | NULL | |
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
<style> | |
ul li:first-child { | |
color: green; | |
} | |
ul li:last-child { | |
color: red; | |
} | |
</style> | |
<ul> | |
<li>1</li> |
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
sec1 = "(1) toplama" | |
sec2 = "(2) çıkarma" | |
sec3 = "(3) çarpma" | |
sec4 = "(4) bölme" | |
puts sec1 | |
puts sec2 | |
puts sec3 | |
puts sec4 |
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
# Middleware: my_app.rb | |
class MyApp < Sinatra::Base | |
enable :sessions | |
get '/testing' do | |
puts env['rack.session'].inspect | |
'testing' | |
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
it "tests something..." do | |
sess = {'warden.user.user.key' => [User, User.first.id]} | |
encoded = [Marshal.dump(sess)].pack("m*") | |
get "/testing", {}, {'HTTP_COOKIE' => "rack.session=" + encoded} | |
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
# config/initializers/action_mailer_ext.rb | |
# For Rails 2.x | |
if Rails.env.staging? | |
class ActionMailer::Base | |
def recipients(*params) | |
@recipients = "staging@example.com" | |
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
<div style="background-color: green; width:500px; height: 500px">Text</div> |
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
# eg: I am on the advertisers ad campaign's the ad's edit page | |
when /^the (.+?) #{capture_model}(?:'s)? #{capture_model}(?:'s)? (.+?) page$/ | |
polymorphic_path [$1.to_sym, model($2), model($3)], :action => $4 | |
# eg: I am on the advertisers the ad campaign's the ad's page | |
when /^the (.+?) #{capture_model}(?:'s)? #{capture_model}(?:'s)? page$/ | |
polymorphic_path [$1.to_sym, model($2), model($3)] | |
# eg: I am on the advertisers the ad's edit page | |
when /^the (.+?) #{capture_model}(?:'s)? (.+?) page$/ |
OlderNewer