class Hobo::FrontControllerGenerator

Public Instance Methods

add_routes() click to toggle source
# File lib/generators/hobo/front_controller/front_controller_generator.rb, line 44
def add_routes
  return unless options[:add_routes]
  route "get 'search' => '#{file_path}#search', :as => 'site_search'"
  route "post 'search' => '#{file_path}#search', :as => 'site_search_post'"
  route "get '#{options[:user_resource_name]}s/:id/activate_from_email/:key' => '#{options[:user_resource_name]}s#activate', :as => 'activate_from_email'"
  route "get '#{options[:user_resource_name]}s/:id/accept_invitation_from_email/:key' => '#{options[:user_resource_name]}s#accept_invitation', :as => 'accept_invitation_from_email'"
  route "get '#{options[:user_resource_name]}s/:id/reset_password_from_email/:key' => '#{options[:user_resource_name]}s#reset_password', :as => 'reset_password_from_email'"
  if class_path.empty?
    route "root :to => '#{file_path}#index'"
    route "get ENV['RAILS_RELATIVE_URL_ROOT'] => 'front#index' if ENV['RAILS_RELATIVE_URL_ROOT']"
  else
    route "get '#{file_path}' => '#{file_path}#index', :as => '#{file_path.gsub(/\//,'_')}'"
  end
end
generate_controller() click to toggle source
# File lib/generators/hobo/front_controller/front_controller_generator.rb, line 31
def generate_controller
  template 'controller.rb.erb', File.join('app/controllers',"#{file_path}_controller.rb")
end
generate_index() click to toggle source
# File lib/generators/hobo/front_controller/front_controller_generator.rb, line 35
def generate_index
  template("index.dryml", File.join('app/views', file_path, "index.dryml"))
end
remove_index_html() click to toggle source
# File lib/generators/hobo/front_controller/front_controller_generator.rb, line 39
def remove_index_html
  return unless options[:delete_index]
  remove_file File.join(Rails.root, "public/index.html")
end

Public Class Methods

banner() click to toggle source