Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed namespaced controllers.

  • Loading branch information...
commit 94e18ee74a1dd850bb36ac15ab38ddfcb1d6b95e 1 parent 9c148b4
Francesc Esplugas authored
View
22 README.md
@@ -62,6 +62,28 @@ and migrate your database.
To create the first user, start the application server, go to
http://0.0.0.0:3000/admin and follow the instructions.
+## Namespaced Models?
+
+If you want to be able to use `delayed_job` you need to add the following
+two lines to your `config/routes.rb` file.
+
+ map.connect "admin/delayed/jobs/:action/:id", :controller => "admin/delayed/jobs"
+ map.connect "admin/delayed/jobs/:action/:id.:format", :controller => "admin/delayed/jobs"
+
+And then create and configure `config/typus/delayed_job.yml` and
+`config/typus/delayed_job_roles.yml` as you do with your other models.
+
+ # config/typus/delayed_job.yml
+ Delayed::Job:
+ fields:
+ list: ...
+ form: ...
+ search: ...
+
+ # config/typus/delayed_job_roles.yml
+ admin:
+ Delayed::Job: all
+
## Support
As an experiment we encourage you to support this project by
View
2  app/helpers/typus_helper.rb
@@ -86,7 +86,7 @@ def header
def login_info(user = @current_user)
- admin_edit_typus_user_path = { :controller => "admin/#{Typus::Configuration.options[:user_class_name].tableize}",
+ admin_edit_typus_user_path = { :controller => "/admin/#{Typus::Configuration.options[:user_class_name].tableize}",
:action => 'edit',
:id => user.id }
View
0  config/routes.rb → config/typus_routes.rb
File renamed without changes
View
13 lib/extensions/routes.rb
@@ -0,0 +1,13 @@
+class ActionController::Routing::RouteSet
+
+ def load_routes_with_typus!
+ typus_routes = File.join(File.dirname(__FILE__), *%w[.. .. config typus_routes.rb])
+ unless configuration_files.include? typus_routes
+ add_configuration_file(typus_routes)
+ end
+ load_routes_without_typus!
+ end
+
+ alias_method_chain :load_routes!, :typus
+
+end
View
1  lib/typus.rb
@@ -98,6 +98,7 @@ def boot!
require "extensions/object"
require "extensions/string"
require "extensions/active_record"
+ require "extensions/routes"
# Load configuration and roles.
Typus::Configuration.config!
Please sign in to comment.
Something went wrong with that request. Please try again.