Consider these models: class First < ActiveRecord::Base has_many :tags has_many :thirds, :through => :tags
i have a problem which is i believe basic for most of the RoR developers. In fact, it\'s more about \"understanding\" than really programming it (i have already been programming a few modules to be ab
So, sometimes you just need a list of options for your selects. Is there a simple gem out there that makes i开发者_Python百科t easy to use one table for all the types of options you might have in your
Normally one would build a related model instance through its parent object: @child = @parent.children.build(params[:child])
Previously, I asked this question about compound indexes on polymorphic foreign keys in ActiveRecord.The basis of my question was my understanding that indexes should be based on the cardinality of yo
Maybe STI isn\'t what I want, and I\'m open to all suggestions, but for 开发者_如何转开发the sake of this questions let\'s assume the following real world situation:
I think I need to use STI in Rails. Here\'s my class: class Person < ActiveRecord::Base end class Landlord < Person
I have STI model开发者_如何转开发s in my Rails application. The ancestor model has validations with the validates_... methods which are working fine.
I\'m developing a project where I have an entity which may have two kinds of assets: Pictures and Videos, basically.
I\'ve been banging my head against a wall trying to wrap my head around this, so any guidance would be much appreciated...