Sha256: 2f35d70edacf1b584203ec7427cb34c944ab0df379666fd1d3468d53b69e84a6

Contents?: true

Size: 886 Bytes

Versions: 1

Compression:

Stored size: 886 Bytes

Contents

say "Building admin"
generate(:controller, "admin/dashboard index")

inject_into_file 'config/routes.rb', :after => "devise_for :users\n" do
<<-RUBY
  match 'admin' => 'admin/dashboard#index'
RUBY
end

# 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 :authenticate_user!  
end
RUBY
end

gsub_file 'app/controllers/admin/dashboard_controller.rb', /ApplicationController/, 'Admin::BaseController'

# make a user admin
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__)
apply File.expand_path("../admin/cucumber.rb", __FILE__)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
prologue-0.2.0 templates/admin.rb