radmin 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/.gitignore +7 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +4 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README +30 -0
  6. data/Rakefile +9 -0
  7. data/app/controllers/admin/accounts_controller.rb +16 -0
  8. data/app/controllers/admin/passwords_controller.rb +4 -0
  9. data/app/controllers/admin/sessions_controller.rb +13 -0
  10. data/app/controllers/admin/settings_controller.rb +40 -0
  11. data/app/controllers/admin/users_controller.rb +43 -0
  12. data/app/controllers/admin_controller.rb +15 -0
  13. data/app/helpers/admin_helper.rb +45 -0
  14. data/app/models/radmin/assignment.rb +8 -0
  15. data/app/models/radmin/role.rb +8 -0
  16. data/app/models/radmin/setting.rb +38 -0
  17. data/app/models/radmin/user.rb +18 -0
  18. data/app/views/admin/accounts/edit.html.haml +11 -0
  19. data/app/views/admin/passwords/edit.html.haml +11 -0
  20. data/app/views/admin/passwords/new.html.haml +8 -0
  21. data/app/views/admin/sessions/new.html.haml +9 -0
  22. data/app/views/admin/settings/_form.html.haml +12 -0
  23. data/app/views/admin/settings/edit.html.haml +3 -0
  24. data/app/views/admin/settings/index.html.haml +18 -0
  25. data/app/views/admin/settings/new.html.haml +3 -0
  26. data/app/views/admin/users/_form.html.haml +21 -0
  27. data/app/views/admin/users/edit.html.haml +3 -0
  28. data/app/views/admin/users/index.html.haml +18 -0
  29. data/app/views/admin/users/new.html.haml +3 -0
  30. data/app/views/layouts/admin.html.haml +40 -0
  31. data/config/routes.rb +10 -0
  32. data/lib/generators/radmin/install_generator.rb +31 -0
  33. data/lib/generators/radmin/templates/assets/images/admin/topnav_active.gif +0 -0
  34. data/lib/generators/radmin/templates/assets/images/admin/topnav_stretch.gif +0 -0
  35. data/lib/generators/radmin/templates/assets/javascripts/admin/application.js +1 -0
  36. data/lib/generators/radmin/templates/assets/javascripts/admin/jquery.js +16 -0
  37. data/lib/generators/radmin/templates/assets/javascripts/admin/jquery.rails.js +226 -0
  38. data/lib/generators/radmin/templates/assets/stylesheets/admin/reset.css +48 -0
  39. data/lib/generators/radmin/templates/assets/stylesheets/admin/style.css +422 -0
  40. data/lib/generators/radmin/templates/authorization_rules.rb +17 -0
  41. data/lib/generators/radmin/templates/migrations/01_radmin_create_users.rb +17 -0
  42. data/lib/generators/radmin/templates/migrations/02_radmin_create_roles.rb +13 -0
  43. data/lib/generators/radmin/templates/migrations/03_radmin_create_assignments.rb +15 -0
  44. data/lib/generators/radmin/templates/migrations/04_radmin_create_settings.rb +15 -0
  45. data/lib/radmin.rb +5 -0
  46. data/lib/radmin/admin_ui.rb +136 -0
  47. data/lib/radmin/engine.rb +8 -0
  48. data/lib/radmin/i18n.rb +14 -0
  49. data/lib/radmin/version.rb +3 -0
  50. data/lib/tasks/radmin.rake +13 -0
  51. data/radmin.gemspec +32 -0
  52. data/spec/dummy/Rakefile +7 -0
  53. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  54. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  55. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  56. data/spec/dummy/config.ru +4 -0
  57. data/spec/dummy/config/application.rb +45 -0
  58. data/spec/dummy/config/authorization_rules.rb +17 -0
  59. data/spec/dummy/config/boot.rb +10 -0
  60. data/spec/dummy/config/database.yml +22 -0
  61. data/spec/dummy/config/environment.rb +5 -0
  62. data/spec/dummy/config/environments/development.rb +28 -0
  63. data/spec/dummy/config/environments/production.rb +49 -0
  64. data/spec/dummy/config/environments/test.rb +35 -0
  65. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  66. data/spec/dummy/config/initializers/devise.rb +194 -0
  67. data/spec/dummy/config/initializers/inflections.rb +10 -0
  68. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  69. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  70. data/spec/dummy/config/initializers/session_store.rb +8 -0
  71. data/spec/dummy/config/locales/en.yml +5 -0
  72. data/spec/dummy/config/routes.rb +58 -0
  73. data/spec/dummy/db/migrate/20110524171909_radmin_create_users.rb +17 -0
  74. data/spec/dummy/db/migrate/20110524171910_radmin_create_roles.rb +13 -0
  75. data/spec/dummy/db/migrate/20110524171911_radmin_create_assignments.rb +15 -0
  76. data/spec/dummy/db/migrate/20110524171912_radmin_create_settings.rb +15 -0
  77. data/spec/dummy/db/schema.rb +59 -0
  78. data/spec/dummy/public/404.html +26 -0
  79. data/spec/dummy/public/422.html +26 -0
  80. data/spec/dummy/public/500.html +26 -0
  81. data/spec/dummy/public/favicon.ico +0 -0
  82. data/spec/dummy/public/images/admin/topnav_active.gif +0 -0
  83. data/spec/dummy/public/images/admin/topnav_stretch.gif +0 -0
  84. data/spec/dummy/public/javascripts/admin/application.js +1 -0
  85. data/spec/dummy/public/javascripts/admin/jquery.js +16 -0
  86. data/spec/dummy/public/javascripts/admin/jquery.rails.js +226 -0
  87. data/spec/dummy/public/javascripts/application.js +2 -0
  88. data/spec/dummy/public/javascripts/controls.js +965 -0
  89. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  90. data/spec/dummy/public/javascripts/effects.js +1123 -0
  91. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  92. data/spec/dummy/public/javascripts/rails.js +191 -0
  93. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  94. data/spec/dummy/public/stylesheets/admin/reset.css +48 -0
  95. data/spec/dummy/public/stylesheets/admin/style.css +422 -0
  96. data/spec/dummy/script/rails +6 -0
  97. data/spec/dummy/vendor/plugins/dynamic_form/MIT-LICENSE +20 -0
  98. data/spec/dummy/vendor/plugins/dynamic_form/README +13 -0
  99. data/spec/dummy/vendor/plugins/dynamic_form/Rakefile +10 -0
  100. data/spec/dummy/vendor/plugins/dynamic_form/dynamic_form.gemspec +12 -0
  101. data/spec/dummy/vendor/plugins/dynamic_form/init.rb +1 -0
  102. data/spec/dummy/vendor/plugins/dynamic_form/lib/action_view/helpers/dynamic_form.rb +300 -0
  103. data/spec/dummy/vendor/plugins/dynamic_form/lib/action_view/locale/en.yml +8 -0
  104. data/spec/dummy/vendor/plugins/dynamic_form/lib/dynamic_form.rb +5 -0
  105. data/spec/dummy/vendor/plugins/dynamic_form/test/dynamic_form_i18n_test.rb +42 -0
  106. data/spec/dummy/vendor/plugins/dynamic_form/test/dynamic_form_test.rb +370 -0
  107. data/spec/dummy/vendor/plugins/dynamic_form/test/test_helper.rb +9 -0
  108. data/spec/integration/navigation_spec.rb +9 -0
  109. data/spec/radmin_spec.rb +7 -0
  110. data/spec/spec_helper.rb +33 -0
  111. metadata +270 -0
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,28 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the webserver when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+
23
+ # Only use best-standards-support built into browsers
24
+ config.action_dispatch.best_standards_support = :builtin
25
+
26
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
27
+ end
28
+
@@ -0,0 +1,49 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
7
+
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
+
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
+
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
+
18
+ # If you have no front-end server that supports something like X-Sendfile,
19
+ # just comment this out and Rails will serve the files
20
+
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
+
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
+
27
+ # Use a different cache store in production
28
+ # config.cache_store = :mem_cache_store
29
+
30
+ # Disable Rails's static asset server
31
+ # In production, Apache or nginx will already do this
32
+ config.serve_static_assets = false
33
+
34
+ # Enable serving of images, stylesheets, and javascripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+ # Disable delivery errors, bad email addresses will be ignored
38
+ # config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Enable threaded mode
41
+ # config.threadsafe!
42
+
43
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
+ # the I18n.default_locale when a translation can not be found)
45
+ config.i18n.fallbacks = true
46
+
47
+ # Send deprecation notices to registered listeners
48
+ config.active_support.deprecation = :notify
49
+ end
@@ -0,0 +1,35 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Tell Action Mailer not to deliver emails to the real world.
24
+ # The :test delivery method accumulates sent emails in the
25
+ # ActionMailer::Base.deliveries array.
26
+ config.action_mailer.delivery_method = :test
27
+
28
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
29
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
30
+ # like if you have constraints or database-specific column types
31
+ # config.active_record.schema_format = :sql
32
+
33
+ # Print deprecation notices to the stderr
34
+ config.active_support.deprecation = :stderr
35
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,194 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
+ # four configuration values can also be set straight in your models.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in DeviseMailer.
6
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
7
+
8
+ # Configure the class responsible to send e-mails.
9
+ # config.mailer = "Devise::Mailer"
10
+
11
+ # ==> ORM configuration
12
+ # Load and configure the ORM. Supports :active_record (default) and
13
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
14
+ # available as additional gems.
15
+ require 'devise/orm/active_record'
16
+
17
+ # ==> Configuration for any authentication mechanism
18
+ # Configure which keys are used when authenticating a user. The default is
19
+ # just :email. You can configure it to use [:username, :subdomain], so for
20
+ # authenticating a user, both parameters are required. Remember that those
21
+ # parameters are used only when authenticating and not when retrieving from
22
+ # session. If you need permissions, you should implement that in a before filter.
23
+ # You can also supply a hash where the value is a boolean determining whether
24
+ # or not authentication should be aborted when the value is not present.
25
+ # config.authentication_keys = [ :email ]
26
+
27
+ # Configure parameters from the request object used for authentication. Each entry
28
+ # given should be a request method and it will automatically be passed to the
29
+ # find_for_authentication method and considered in your model lookup. For instance,
30
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
31
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
32
+ # config.request_keys = []
33
+
34
+ # Configure which authentication keys should be case-insensitive.
35
+ # These keys will be downcased upon creating or modifying a user and when used
36
+ # to authenticate or find a user. Default is :email.
37
+ config.case_insensitive_keys = [ :email ]
38
+
39
+ # Tell if authentication through request.params is enabled. True by default.
40
+ # config.params_authenticatable = true
41
+
42
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
43
+ # config.http_authenticatable = false
44
+
45
+ # If http headers should be returned for AJAX requests. True by default.
46
+ # config.http_authenticatable_on_xhr = true
47
+
48
+ # The realm used in Http Basic Authentication. "Application" by default.
49
+ # config.http_authentication_realm = "Application"
50
+
51
+ # ==> Configuration for :database_authenticatable
52
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
53
+ # using other encryptors, it sets how many times you want the password re-encrypted.
54
+ config.stretches = 10
55
+
56
+ # Setup a pepper to generate the encrypted password.
57
+ # config.pepper = <%= ActiveSupport::SecureRandom.hex(64).inspect %>
58
+
59
+ # ==> Configuration for :confirmable
60
+ # The time you want to give your user to confirm his account. During this time
61
+ # he will be able to access your application without confirming. Default is 0.days
62
+ # When confirm_within is zero, the user won't be able to sign in without confirming.
63
+ # You can use this to let your user access some features of your application
64
+ # without confirming the account, but blocking it after a certain period
65
+ # (ie 2 days).
66
+ # config.confirm_within = 2.days
67
+
68
+ # Defines which key will be used when confirming an account
69
+ # config.confirmation_keys = [ :email ]
70
+
71
+ # ==> Configuration for :rememberable
72
+ # The time the user will be remembered without asking for credentials again.
73
+ # config.remember_for = 2.weeks
74
+
75
+ # If true, a valid remember token can be re-used between multiple browsers.
76
+ # config.remember_across_browsers = true
77
+
78
+ # If true, extends the user's remember period when remembered via cookie.
79
+ # config.extend_remember_period = false
80
+
81
+ # If true, uses the password salt as remember token. This should be turned
82
+ # to false if you are not using database authenticatable.
83
+ config.use_salt_as_remember_token = true
84
+
85
+ # Options to be passed to the created cookie. For instance, you can set
86
+ # :secure => true in order to force SSL only cookies.
87
+ # config.cookie_options = {}
88
+
89
+ # ==> Configuration for :validatable
90
+ # Range for password length. Default is 6..128.
91
+ # config.password_length = 6..128
92
+
93
+ # Regex to use to validate the email address
94
+ # config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
95
+
96
+ # ==> Configuration for :timeoutable
97
+ # The time you want to timeout the user session without activity. After this
98
+ # time the user will be asked for credentials again. Default is 30 minutes.
99
+ # config.timeout_in = 30.minutes
100
+
101
+ # ==> Configuration for :lockable
102
+ # Defines which strategy will be used to lock an account.
103
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
104
+ # :none = No lock strategy. You should handle locking by yourself.
105
+ # config.lock_strategy = :failed_attempts
106
+
107
+ # Defines which key will be used when locking and unlocking an account
108
+ # config.unlock_keys = [ :email ]
109
+
110
+ # Defines which strategy will be used to unlock an account.
111
+ # :email = Sends an unlock link to the user email
112
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
113
+ # :both = Enables both strategies
114
+ # :none = No unlock strategy. You should handle unlocking by yourself.
115
+ # config.unlock_strategy = :both
116
+
117
+ # Number of authentication tries before locking an account if lock_strategy
118
+ # is failed attempts.
119
+ # config.maximum_attempts = 20
120
+
121
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
122
+ # config.unlock_in = 1.hour
123
+
124
+ # ==> Configuration for :recoverable
125
+ #
126
+ # Defines which key will be used when recovering the password for an account
127
+ # config.reset_password_keys = [ :email ]
128
+
129
+ # Time interval you can reset your password with a reset password key.
130
+ # Don't put a too small interval or your users won't have the time to
131
+ # change their passwords.
132
+ config.reset_password_within = 2.hours
133
+
134
+ # ==> Configuration for :encryptable
135
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
136
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
137
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
138
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
139
+ # REST_AUTH_SITE_KEY to pepper)
140
+ # config.encryptor = :sha512
141
+
142
+ # ==> Configuration for :token_authenticatable
143
+ # Defines name of the authentication token params key
144
+ # config.token_authentication_key = :auth_token
145
+
146
+ # If true, authentication through token does not store user in session and needs
147
+ # to be supplied on each request. Useful if you are using the token as API token.
148
+ # config.stateless_token = false
149
+
150
+ # ==> Scopes configuration
151
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
152
+ # "users/sessions/new". It's turned off by default because it's slower if you
153
+ # are using only default views.
154
+ config.scoped_views = true
155
+
156
+ # Configure the default scope given to Warden. By default it's the first
157
+ # devise role declared in your routes (usually :user).
158
+ # config.default_scope = :user
159
+
160
+ # Configure sign_out behavior.
161
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
162
+ # The default is true, which means any logout action will sign out all active scopes.
163
+ # config.sign_out_all_scopes = true
164
+
165
+ # ==> Navigation configuration
166
+ # Lists the formats that should be treated as navigational. Formats like
167
+ # :html, should redirect to the sign in page when the user does not have
168
+ # access, but formats like :xml or :json, should return 401.
169
+ #
170
+ # If you have any extra navigational formats, like :iphone or :mobile, you
171
+ # should add them to the navigational formats lists.
172
+ #
173
+ # The :"*/*" and "*/*" formats below is required to match Internet
174
+ # Explorer requests.
175
+ # config.navigational_formats = [:"*/*", "*/*", :html]
176
+
177
+ # The default HTTP method used to sign out a resource. Default is :get.
178
+ # config.sign_out_via = :get
179
+
180
+ # ==> OmniAuth
181
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
182
+ # up on your models and hooks.
183
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
184
+
185
+ # ==> Warden configuration
186
+ # If you want to use other strategies, that are not supported by Devise, or
187
+ # change the failure app, you can configure them inside the config.warden block.
188
+ #
189
+ # config.warden do |manager|
190
+ # manager.failure_app = AnotherApp
191
+ # manager.intercept_401 = false
192
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
193
+ # end
194
+ end
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '7cb89de17243c65b65e62a7ff4f6b692ae628d54aee73935e332248d9edfc87635cceda3c2dd127cbb403f6d25b9a4b04da64034f0b57824e124a67c8e8b5804'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,58 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get 'short'
20
+ # post 'toggle'
21
+ # end
22
+ #
23
+ # collection do
24
+ # get 'sold'
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get 'recent', :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ # root :to => "welcome#index"
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id(.:format)))'
58
+ end
@@ -0,0 +1,17 @@
1
+ class RadminCreateUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :radmin_users do |t|
4
+ t.database_authenticatable
5
+ t.recoverable
6
+ t.trackable
7
+ t.timestamps
8
+ end
9
+
10
+ add_index :radmin_users, :email, :unique => true
11
+ add_index :radmin_users, :reset_password_token, :unique => true
12
+ end
13
+
14
+ def self.down
15
+ drop_table :radmin_users
16
+ end
17
+ end