app/models/cardboard/template.rb in cardboard_cms-0.2.2 vs app/models/cardboard/template.rb in cardboard_cms-0.3.1
- old
+ new
@@ -5,9 +5,14 @@
has_many :pages
validates :identifier, uniqueness: {:case_sensitive => false}, :format => { :with => /\A[a-z\_0-9]+\z/,
:message => "Only downcase letters, numbers and underscores are allowed" }
+
+ after_save :reload_routes
+ def reload_routes
+ DynamicRouter.reload
+ end
def name
self[:name] || self.identifier
end
end