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 Fixture < ActiveRecord::Base | |
belongs_to :user | |
validates :home_team, :home_score_bet, :away_team, :away_score_bet, presence: true | |
validates :home_score_bet, :away_score_bet, numericality: { only_integer: true } | |
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
Every user has the same set of fixtures, in the same order. They just change their fields accordingly. | |
The problem I'm having (happening on production only) is that both on '/fixtures/index' and when editing on '/users/edit' | |
the fixtures are getting mixed up every time I update one. | |
Issue not happening on development ENV. |
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
source 'https://rubygems.org' | |
# Add email validation | |
gem 'validates_email_format_of' | |
# Handle file upload | |
gem "carrierwave" | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.2' |
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
def set_description_for_stripe | |
# A sample string would be "example@email.com: 1. Black Medium Lightning 2. Matte Silver Small Lightning" | |
str = "#{params[:email]}: " # => "example@email.com " | |
loop_count = 1 | |
params[:order][:bracelets_attributes].map do |bracelet| | |
str << "#{loop_count}. " # => "example@email.com 1. " | |
# getting error in the next line: can't convert Symbol into Integer | |
str << "#{bracelet[loop_count-1]["color"]} " # => "example@email.com 1. Black " | |
str << "#{bracelet[loop_count-1]["size"]} " # => "example@email.com 1. Black Medium " | |
str << "#{bracelet[loop_count-1]["kind"]} " # => "example@email.com 1. Black Medium Lightning" |
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
/** | |
* | |
* NewMapComponent | |
* | |
* Places markers on a map or represents values as a color code | |
* | |
Changelog 2014-02-27 ------------- | |
Support for representing data as a colored shape in a map, | |
e.g. population of a country using a color map. |
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
Watch this first: | |
How to teach yourself to code (video) | |
https://www.youtube.com/watch?v=T0qAjgQFR4c | |
Let the fun begin: | |
Dip your toes: | |
Codecademy.com | |
* Javascript course | |
* HTML + CSS course |
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 'rails_helper' | |
feature "User visits his profile page" do | |
before(:each) do | |
@user = create(:user) | |
login_as @user | |
visit user_path(@user) | |
end | |
scenario "and has following" do |
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
Building native extensions. This could take a while... | |
ERROR: Error installing eventmachine: | |
ERROR: Failed to build gem native extension. | |
/Users/max/.rbenv/versions/1.9.3-p484/bin/ruby extconf.rb | |
checking for rb_trap_immediate in ruby.h,rubysig.h... no | |
checking for rb_thread_blocking_region()... yes | |
checking for ruby/thread.h... no | |
checking for inotify_init() in sys/inotify.h... no | |
checking for __NR_inotify_init in sys/syscall.h... no |
OlderNewer