Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Speed your app
creation with templates
need some rails power? www.tinci.fr@happynoff
Simon Courtois
www.tinci.fr
happynoff
simonc
need some rails power? www.tinci.fr@happynoff
Every new app!
need some rails power? www.tinci.fr@happynoff
Add usual gems
Create initializers
Set default locale
Run generators
need some rails power? www.tinci.fr@happynoff
A simple Ruby file
need some rails power? www.tinci.fr@happynoff
rails new -m template.rb
need some rails power? www.tinci.fr@happynoff
Add usual gems
Create initializers
Set default locale
Run generators
need some rails power? www.tinci.fr@happynoff
gem 'bootstrap-sass','~> 3.3'
need some rails power? www.tinci.fr@happynoff
gem_group :development do
gem 'better_errors'
end
need some rails power? www.tinci.fr@happynoff
Add usual gems
Create initializers
Set default locale
Run generators
need some rails power? www.tinci.fr@happynoff
initializer 'hello.rb',
'Hello = 42'
need some rails power? www.tinci.fr@happynoff
initializer 'mustdown.rb', <<-CODE
Mustdown.configure do |config|
config.ren...
need some rails power? www.tinci.fr@happynoff
Add usual gems
Create initializers
Set default locale
Run generators
need some rails power? www.tinci.fr@happynoff
insert_into_file
'config/application.rb',
"config.i18n.default_locale = :frn...
need some rails power? www.tinci.fr@happynoff
Add usual gems
Create initializers
Set default locale
Run generators
need some rails power? www.tinci.fr@happynoff
after_bundle do
generate
'simple_form:install',
'--bootstrap'
end
need some rails power? www.tinci.fr@happynoff
And it’s just Ruby!
need some rails power? www.tinci.fr@happynoff
doing_admin = ask('Need admin?')
if doing_admin
gem 'rails_admin', '~> 0.6.7...
need some rails power? www.tinci.fr@happynoff
Run commands
need some rails power? www.tinci.fr@happynoff
run "wget ...
-O config/locales/devise.fr.yml"
need some rails power? www.tinci.fr@happynoff
Use git
need some rails power? www.tinci.fr@happynoff
after_bundle
do
git :init
git add: '.'
end
Learn more
guides.rubyonrails.org/
rails_application_templates.html
need some rails power? www.tinci.fr@happynoff
Questions?
need some rails power? www.tinci.fr@happynoff
Thanks!
Upcoming SlideShare
Loading in …5
×

Speed your Rails app creation with templates

608 views

Published on

Slides of my talk at Paris.rb on 08/04/15 about Rails application templates.

Published in: Technology
  • Be the first to comment

Speed your Rails app creation with templates

  1. 1. Speed your app creation with templates
  2. 2. need some rails power? www.tinci.fr@happynoff Simon Courtois www.tinci.fr happynoff simonc
  3. 3. need some rails power? www.tinci.fr@happynoff Every new app!
  4. 4. need some rails power? www.tinci.fr@happynoff Add usual gems Create initializers Set default locale Run generators
  5. 5. need some rails power? www.tinci.fr@happynoff A simple Ruby file
  6. 6. need some rails power? www.tinci.fr@happynoff rails new -m template.rb
  7. 7. need some rails power? www.tinci.fr@happynoff Add usual gems Create initializers Set default locale Run generators
  8. 8. need some rails power? www.tinci.fr@happynoff gem 'bootstrap-sass','~> 3.3'
  9. 9. need some rails power? www.tinci.fr@happynoff gem_group :development do gem 'better_errors' end
  10. 10. need some rails power? www.tinci.fr@happynoff Add usual gems Create initializers Set default locale Run generators
  11. 11. need some rails power? www.tinci.fr@happynoff initializer 'hello.rb', 'Hello = 42'
  12. 12. 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
  13. 13. need some rails power? www.tinci.fr@happynoff Add usual gems Create initializers Set default locale Run generators
  14. 14. need some rails power? www.tinci.fr@happynoff insert_into_file 'config/application.rb', "config.i18n.default_locale = :frn", after: ":den"
  15. 15. need some rails power? www.tinci.fr@happynoff Add usual gems Create initializers Set default locale Run generators
  16. 16. need some rails power? www.tinci.fr@happynoff after_bundle do generate 'simple_form:install', '--bootstrap' end
  17. 17. need some rails power? www.tinci.fr@happynoff And it’s just Ruby!
  18. 18. 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
  19. 19. need some rails power? www.tinci.fr@happynoff Run commands
  20. 20. need some rails power? www.tinci.fr@happynoff run "wget ... -O config/locales/devise.fr.yml"
  21. 21. need some rails power? www.tinci.fr@happynoff Use git
  22. 22. need some rails power? www.tinci.fr@happynoff after_bundle do git :init git add: '.' end
  23. 23. Learn more guides.rubyonrails.org/ rails_application_templates.html
  24. 24. need some rails power? www.tinci.fr@happynoff Questions?
  25. 25. need some rails power? www.tinci.fr@happynoff Thanks!

×