Class: Pageflow::Generators::RoutesGenerator Private

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pageflow/routes/routes_generator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#add_routeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/pageflow/routes/routes_generator.rb', line 9

def add_route
  inject_into_file 'config/routes.rb', after: "  ActiveAdmin.routes(self)\n" do
    <<-HEREDOC
  authenticate :user, lambda { |user| user.admin? } do
    mount Resque::Server.new, at: "/background_jobs"
  end

  # Needs to be last in file
  Pageflow.routes(self)
    HEREDOC
  end
end

#require_resque_serverObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
# File 'lib/generators/pageflow/routes/routes_generator.rb', line 22

def require_resque_server
  prepend_to_file 'config/routes.rb',
                  "require 'resque/server'\nrequire 'resque/scheduler/server'\n\n"
end