Class: ActionDispatch::Routing::Mapper
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/opinio/rails/routes.rb
Instance Method Summary collapse
Instance Method Details
#opinio(*args) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/opinio/rails/routes.rb', line 3 def opinio(*args) = args..symbolize_keys route_name = [:path_name] || Opinio.model_name.pluralize.downcase [:controller] ||= 'opinio/comments' get "#{ route_name }(/:page)" => "#{[:controller].to_s}#index", :as => :comments end |
#opinio_model(*args) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/opinio/rails/routes.rb', line 11 def opinio_model(*args) = args. [:controller] ||= 'opinio/comments' resources :comments, do get 'reply', :on => :member if Opinio.accept_replies end end |