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
module M | |
def i_method | |
define_method(:new_method) do | |
"I am from i_method, but I should be an instance method" | |
end | |
end | |
end | |
class C | |
extend M |
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
##### CODE IN models/users/show.html.erb ###### | |
<%= form_for user do |f| %> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
<% Team.all.each do |team|%> | |
<%= check_box_tag( "user[team_ids][]", team.id, | |
user.team_ids.include?(team.id), | |
id: "user_team_ids_#{team.id}" |
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
[5] pry(main)> prime? 5 | |
[2, 11] in /Users/kdavh/Google Drive/cs/2013 App Academy/Coursework/w1d1/primes.rb | |
2 require 'debugger' | |
3 | |
4 def prime?(num) | |
5 debugger | |
6 | |
=> 7 (2..num/2).each do |i| | |
8 if (num % i) == 0 |
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
/* | |
Ratings Stars | |
(with as little code as possible) | |
*/ | |
.rating { | |
unicode-bidi: bidi-override; | |
direction: rtl; | |
text-align: center; | |
} | |
.rating > span { |