speed your rails app creation with templates

25
Speed your app creation with templates

Upload: simon-courtois

Post on 15-Jul-2015

229 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Speed your Rails app creation with templates

Speed your app creation with templates

Page 2: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Simon Courtois

www.tinci.fr

happynoff

simonc

Page 3: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Every new app!

Page 4: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Add usual gemsCreate initializersSet default localeRun generators

Page 5: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

A simple Ruby file

Page 6: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

rails new -m template.rb

Page 7: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Add usual gemsCreate initializersSet default localeRun generators

Page 8: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

gem 'bootstrap-sass','~> 3.3'

Page 9: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

gem_group :development do gem 'better_errors' end

Page 10: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Add usual gemsCreate initializersSet default localeRun generators

Page 11: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

initializer 'hello.rb', 'Hello = 42'

Page 12: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

initializer 'mustdown.rb', <<-CODE Mustdown.configure do |config| config.renderer_options = { with_toc_data: true } end CODE

Page 13: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Add usual gemsCreate initializersSet default localeRun generators

Page 14: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

insert_into_file 'config/application.rb', "config.i18n.default_locale = :fr\n", after: ":de\n"

Page 15: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Add usual gemsCreate initializersSet default localeRun generators

Page 16: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

after_bundle do generate 'simple_form:install', '--bootstrap' end

Page 17: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

And it’s just Ruby!

Page 18: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

doing_admin = ask('Need admin?')

if doing_admin gem 'rails_admin', '~> 0.6.7'

after_bundle do generator '' end end

Page 19: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Run commands

Page 20: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

run "wget ... -O config/locales/devise.fr.yml"

Page 21: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Use git

Page 22: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

after_bundle do git :init git add: '.' end

Page 23: Speed your Rails app creation with templates

Learn more

guides.rubyonrails.org/ rails_application_templates.html

Page 24: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Questions?

Page 25: Speed your Rails app creation with templates

need some rails power? www.tinci.fr@happynoff

Thanks!