Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Admin generator generates broken session controller #846

Merged
merged 1 commit into from

2 participants

@fnordfish

templates for session controller and app.rb need to know about the @model_name

@fnordfish fnordfish Fixes admin generator
templates for session controller and `app.rb` need to know about the `@model_name`
89e2294
@WaYdotNET WaYdotNET referenced this pull request from a commit in WaYdotNET/padrino-framework
@WaYdotNET WaYdotNET Fixes admin generator #846 68e901d
@DAddYE DAddYE merged commit 0d638b3 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 9, 2012
  1. @fnordfish

    Fixes admin generator

    fnordfish authored
    templates for session controller and `app.rb` need to know about the `@model_name`
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +6 −6 padrino-admin/lib/padrino-admin/generators/admin_app.rb
View
12 padrino-admin/lib/padrino-admin/generators/admin_app.rb
@@ -55,18 +55,18 @@ def create_admin
self.behavior = :revoke if options[:destroy]
empty_directory destination_root("admin")
- directory "templates/app", destination_root("admin")
- directory "templates/assets", destination_root("public", "admin")
- template "templates/app.rb.tt", destination_root("admin/app.rb")
- append_file destination_root("config/apps.rb"), "\nPadrino.mount(\"Admin\").to(\"/admin\")"
- insert_middleware 'ActiveRecord::ConnectionAdapters::ConnectionManagement', 'admin' if [:mini_record, :activerecord].include?(orm)
-
# Setup Admin Model
@model_name = options[:admin_model].classify
@model_singular = @model_name.underscore
@model_plural = @model_singular.pluralize
+ directory "templates/app", destination_root("admin")
+ directory "templates/assets", destination_root("public", "admin")
+ template "templates/app.rb.tt", destination_root("admin/app.rb")
+ append_file destination_root("config/apps.rb"), "\nPadrino.mount(\"Admin\").to(\"/admin\")"
+ insert_middleware 'ActiveRecord::ConnectionAdapters::ConnectionManagement', 'admin' if [:mini_record, :activerecord].include?(orm)
+
params = [
@model_singular, "name:string", "surname:string", "email:string", "crypted_password:string", "role:string",
"-a=#{options[:app]}",
Something went wrong with that request. Please try again.