routes - Drupal-like routing system in Rails -


i trying find best-practice allow users define route pages in rails, writing them in text field when submitting posts, path module in drupal (yes, porting drupal site rails)

so, need to

how can best achieve this?

okay, found way, if it's best practice or not, cant say.

i using custom restrictor's this:

  class charitiesrestrictor     def self.matches?(request)       slug = request.path_parameters[:path]       !charity.find_by_name(slug).nil?     end   end    constraints charitiesrestrictor     match  '*path' => 'charities#show_by_slug', :constraints => charitiesrestrictor.new   end 

when create block each of model/controller pairs should able respond permalinks, can have them have chance act on permalink. however, means called in series, not ideal.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -