Skip to content

Instantly share code, notes, and snippets.

View dougalcorn's full-sized avatar

Doug Alcorn dougalcorn

View GitHub Profile

Web Development with Ruby on Rails and Nitrous.IO.

Introduction

We will create a simple "Wish List" Web application using Ruby on Rails (Rails) and Nitrous.IO (Nitrous).

Rails is a Web application development framework written in the Ruby programming language. It follows a "convention over configuration" philosophy that allows developers to quickly create valuable products if they choose to follow convention. However, Rails is powerful enough to to create applications like Twitter and Groupon.

Nitrous is a Web-based application development service. It permits software developers to focus on writing code and less on the intricacies of their development environment. Their tagline is, "making coding in the cloud a reality." Using Nitrous, you are literally programming a server running in "The Cloud."

class User < ActiveRecord::Base
has_one :candidate_profile
alias_method :candidate_profile_without_initialization :candidate_profile
def candidate_profile
candidate_profile_withough_intitialization || build_candidate_profile
end
end
rec_td_stat_name = StatName.find_by_title("Reception Touchdowns")
rush_td_stat_name = StatName.find_by_title("Rush Touchdowns")
rrtd_stat_name = StatName.find_by_title("Rushing and Receiving Touchdowns")
GameStat.find_all_by_stat_name_id(rrtd_stat_name.id).each do |game_stat|
rec_td_game_stat = GameState.find_by_game_id_and_player_id_and_stat_name_id(game_stat.game_id, game_stat.player_id, rec_td_stat_name.id)
rush_td_game_stat = GameState.find_by_game_id_and_player_id_and_stat_name_id(game_stat.game_id, game_stat.player_id, rush_td_stat_name.id)
game_stat.update_attributes(:value => rec_td_game_stat.value.to_i + rush_td_game_stat.value.to_i)
end