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.5.5 recipes/slim.rb
rails_apps_composer-1.5.4 recipes/slim.rb
rails_apps_composer-1.5.3 recipes/slim.rb
rails_apps_composer-1.5.2 recipes/slim.rb
rails_apps_composer-1.5.1 recipes/slim.rb
thyone_creator-0.0.5 recipes/slim.rb
thyone_creator-0.0.4 recipes/slim.rb
thyone_creator-0.0.3 recipes/slim.rb
thyone_creator-0.0.2 recipes/slim.rb
rails_apps_composer-1.5.0 recipes/slim.rb
rails_apps_composer-1.4.15 recipes/slim.rb
rails_apps_composer-1.4.14 recipes/slim.rb
rails_apps_composer-1.4.13 recipes/slim.rb
rails_apps_composer-1.4.12 recipes/slim.rb
rails_apps_composer-1.4.11 recipes/slim.rb
rails_apps_composer-1.4.10 recipes/slim.rb
rails_apps_composer-1.4.9 recipes/slim.rb
rails_apps_composer-1.4.8 recipes/slim.rb
rails_apps_composer-1.4.7 recipes/slim.rb
rails_apps_composer-1.4.6 recipes/slim.rb