Sha256: ef05567a7038a2d20e1374108cbfb76ff7636857db350e36b376f865927f12e4

Contents?: true

Size: 1.06 KB

Versions: 32

Compression:

Stored size: 1.06 KB

Contents

# Application template recipe for the rails_apps_composer. Check for a newer version here:
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/slim.rb

if config['slim']
  gem 'slim', '~> 1.0'
  gem 'slim-rails', '~> 1.0.3', :group => :development
else
  recipes.delete('slim')
end

after_bundler do
  
  say_wizard "Slim recipe running 'after bundler'"
  
  remove_file 'app/views/layouts/application.html.erb'
  # There is Slim code in this script. Changing the indentation is perilous between SLIMs.
  # We have to use single-quote-style-heredoc to avoid interpolation.
  create_file 'app/views/layouts/application.html.slim' do 
  <<-'SLIM'
doctype html
html
  head
    title App_Name
    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"
    = csrf_meta_tags
  body
    = yield
SLIM
  end

end

__END__

name: SLIM
description: "Utilize Slim instead of ERB."
author: claudiob

category: templating
exclusive: templating

config:
  - slim:
      type: boolean
      prompt: Would you like to use Slim instead of ERB?

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
rails_apps_composer-1.4.5 recipes/slim.rb
rails_apps_composer-1.4.4 recipes/slim.rb
rails_apps_composer-1.4.3 recipes/slim.rb
rails_apps_composer-1.4.2 recipes/slim.rb
rails_apps_composer-1.4.1 recipes/slim.rb
rails_apps_composer-1.3.1 recipes/slim.rb
rails_apps_composer-1.2.1 recipes/slim.rb
rails_apps_composer-1.2.0 recipes/slim.rb
rails_apps_composer-1.1.8 recipes/slim.rb
rails_apps_composer-1.1.7 recipes/slim.rb
rails_apps_composer-1.1.6 recipes/slim.rb
rails_apps_composer-1.1.5 recipes/slim.rb