Tags » Ruby On Rails

Welcome to Running Code

This blog came about as a means of chronicling my early stages of becoming a web developer. Currently, I am a Rails Apprentice at Launch Academy… 325 more words

Launch Academy

ActiveRecord::Dirty in Rails

Performing an action via a callback is fairly easy and doable. Sometimes requirement may be a bit enhanced that we need to track every change now and then. 318 more words

Ruby On Rails

Ruby on Rails : Where not to use find_each

If you have arranged rows of data then you dont use find_each in views

@alerts = @user.alerts.order(updated_at: :desc)

# In views

<% @alerts.find_each do |alert| %
# This will pick data as in default order
# This may throw some Warning like
# Scoped order and limit are ignored, it's forced to be batch order and batch size… 31 more words
Ruby On Rails

Rails active record association: has_many, has_one it returns empty array and nil respectively

Class definitions

class Bid < ActiveRecord::Base
 belongs_to :user
 has_one :project
end
class Project < ActiveRecord::Base
 belongs_to :bid
end
class User < ActiveRecord::Base
 has_many :bids
end… 162 more words
Rails

Install R-Magic

What is RMagick?

RMagick is a binding from Ruby to the ImageMagick TM image manipulation library. Here’s how the ImageMagick home page describes ImageMagick:

ImageMagickTM… is a free software suite to create, edit, and compose bitmap images. 194 more words

Rails