Tags » Ruby On Rails
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
The Very Best Ruby on Rails Workflow – Ever!
Follow My Mag:flip.it/i50ZC
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