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
<%= form_for(@task) do |f| %> | |
<% if @task.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@task.errors.count, "error") %> prohibited this task from being saved:</h2> | |
<ul> | |
<% @task.errors.full_messages.each do |msg| %> | |
<li><%= msg %></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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title><%= content_for?(:title) ? yield(:title) : "TimeTracker" %></title> | |
<%= stylesheet_link_tag "application" %> | |
<%= javascript_include_tag :defaults, :cache => true %> | |
<%= csrf_meta_tag %> | |
<%= yield(:head) %> | |
</head> | |
<body> |
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
5 min: | |
~Objective-C + Rails: | |
Communicating w/rails from iOS/mac OS | |
Dan Hassin | |
1 min: | |
~Painless Javascript | |
koting hatduklgg | |
with wind tunnel |
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 'test/unit' | |
class ARoseByAnyOtherName < Test::Unit::TestCase | |
def test_should_not_be_zack | |
assert_not_equal "Zachary"[0,4],"Zack" | |
# I'm not Zack Morris | |
# though I did have a huge crush on Kelly Kapowski | |
assert_not_equal "Zach Morek","Zack Morris" | |
end | |
def test_should_not_be_zac | |
assert_not_equal "Zachary"[0,4],"Zac" |
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 'test/unit' | |
class ARoseByAnyOtherName < Test::Unit::TestCase | |
def test_should_not_be_zack | |
assert_not_equal "Zachary"[0,4],"Zack" | |
# I'm not Zack Morris | |
# though I did have a huge crush on Kelly Kapowski | |
assert_not_equal "Zach Morek","Zack Morris" | |
end | |
def test_should_not_be_zac | |
assert_not_equal "Zachary"[0,4],"Zac" |
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
#put in lib/tasks/fixtures.rake | |
namespace :db do | |
namespace :fixtures do | |
desc 'Create YAML test fixtures from data in an existing database. | |
Defaults to development database. Set RAILS_ENV to override.' | |
task :dump => :environment do | |
sql = "SELECT * FROM %s" | |
skip_tables = ["schema_migrations"] | |
ActiveRecord::Base.establish_connection(:development) | |
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click_on('Link Text') # Click either a link or a button | |
click_on('Button Value') |