skip to Main Content

Rails keeping params DRY – SEO

I have a model named "seo" class Seo < ApplicationRecord belongs_to :seoable, polymorphic: true # more code end Many models in my application has_one seo. For example class Post < ApplicationRecord has_one :seo, as: :seoable accepts_nested_attributes_for :seo, dependent: :destroy #…

VIEW QUESTION
Back To Top
Search