Sha256: c4039d9827c3224a8c5f98882aa0699d58cbb5cd8ca81f79627465847ed4c42d
Contents?: true
Size: 769 Bytes
Versions: 3
Compression:
Stored size: 769 Bytes
Contents
say '## ADMIN >>' generate(:controller, "admin/dashboard index") # Do layout and SASS stuff #apply File.expand_path("../admin/sass.rb", __FILE__) apply File.expand_path("../admin/layout.rb", __FILE__) create_file 'app/controllers/admin/base_controller.rb' do <<-RUBY class Admin::BaseController < ApplicationController layout 'admin' before_filter :verify_admin private def verify_admin redirect_to root_url unless current_user.has_role? :admin end end RUBY end gsub_file 'app/controllers/admin/dashboard_controller.rb', /ApplicationController/, 'Admin::BaseController' #apply File.expand_path("../admin/users.rb", __FILE__) #apply File.expand_path("../admin/dashboard_spec.rb", __FILE__) #apply File.expand_path("../admin/users_spec.rb", __FILE__)
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rails-maker-0.1.11 | templates/default/lib/admin.rb |
rails-maker-0.1.9 | templates/default/lib/admin.rb |
rails-maker-0.1.7 | templates/default/lib/admin.rb |