Sha256: 8c5aa66b0bb98f5e5310c5fccf12e0effe218d007a01ee4f2ee8f1ec9c805e2d

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

# Application template recipe for the rails3_devise_wizard. Check for a newer version here:
# https://github.com/fortuity/rails3_devise_wizard/blob/master/recipes/home_page.rb

after_bundler do
  
  # remove the default home page
  remove_file 'public/index.html'
  
  # create a home controller and view
  generate(:controller, "home index")

  # set up a simple home page (with placeholder content)
  if recipes.include? 'haml'
    remove_file 'app/views/home/index.html.haml'
    # There is Haml code in this script. Changing the indentation is perilous between HAMLs.
    # We have to use single-quote-style-heredoc to avoid interpolation.
    create_file 'app/views/home/index.html.haml' do 
    <<-'HAML'
%h3 Home
HAML
    end
  else
    remove_file 'app/views/home/index.html.erb'
    create_file 'app/views/home/index.html.erb' do 
    <<-ERB
<h3>Home</h3>
ERB
    end
  end

  # set routes
  gsub_file 'config/routes.rb', /get \"home\/index\"/, 'root :to => "home#index"'

end

__END__

name: HomePage
description: "Create a simple home page (with a home controller and view)."
author: fortuity

category: other
tags: [utilities, configuration]

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails3_devise_wizard-0.2.4 recipes/home_page.rb
rails3_devise_wizard-0.2.3 recipes/home_page.rb
rails3_devise_wizard-0.2.2 recipes/home_page.rb
rails3_devise_wizard-0.2.1 recipes/home_page.rb
rails3_devise_wizard-0.2 recipes/home_page.rb