Javier Valencia
Javier Valencia

Reputation: 695

Where to place own module in rails app?

I create a simple module in ruby to implement on ActiveRecord model.

module Parameterize
  def to_param
    "#{ id } #{ name }".parameterize
  end
end

The question it's where to place the file?

Upvotes: 0

Views: 109

Answers (1)

Taryn East
Taryn East

Reputation: 27747

These generally are placed in a new directory off app called concerns - it's worth googling for more info about how that works.

here's a good ref of places to go look: How to use concerns in Rails 4

Upvotes: 3

Related Questions