Sha256: 31202f31f093eb140874dd4809e34e9d885030c9c8bd8cabaef48adff44f1064
Contents?: true
Size: 1.37 KB
Versions: 4
Compression:
Stored size: 1.37 KB
Contents
require 'rails/generators' module Redde module Generators class LayoutGenerator < ::Rails::Generators::Base source_root File.expand_path("../templates", __FILE__) desc "Standart redde admin generator" attr_reader :app_name def generate_layout # copy layouts %w{ admin login }.each do |layout| template "layouts/#{layout}#{ext}", "app/views/layouts/#{layout}#{ext}" end # copy base directory "base", "app/views/admin/base" # copy js %w{ admin.js }.each do |js| template "assets/javascripts/#{js}", "app/assets/javascripts/#{js}" end directory "assets/javascripts/admin", "app/assets/javascripts/admin" # copy css directory "assets/stylesheets/admin", "app/assets/stylesheets/admin" # copy redactor directory "assets/redactor", "app/assets" # copy helpers template "helpers/admin_helper.rb", "app/helpers/admin_helper.rb" # copy images directory "assets/images/admin", "app/assets/images/admin" # copy application controller template "controllers/base_controller.rb", "app/controllers/admin/base_controller.rb" end private def ext ".html.haml" end def app_name Rails.application.class.to_s.split("::").first end end end end
Version data entries
4 entries across 4 versions & 1 rubygems