RailsCasts Pro episodes are now free!

Learn more or hide this

iumehara's Profile

GitHub User: iumehara

Comments by

Avatar

For those using Bootstrap, note that the preview won't work correctly until you disable bootstrap's default CSS of img { max-width: 100% } by specifying img { max-width: none ).
See here.
https://github.com/twitter/bootstrap/issues/1649

Avatar

Hey all, like @Mark says above, be sure to use reputation_value_for.

Also, the reputation system requires different names for all types of reputations (ie. users and haikus can't share the same reputation name), so the code from the example would be more like:

models/haiku.rb
has_reputation :votes, 
               source: :user, 
               source_of: [{ :reputation: :user_votes, :of => :user }]
               aggregated_by: :sum
models/user.rb
has_reputation :user_votes, 
               source: {reputation: :votes, of: :haikus],                    
               aggregated_by: :sum