Coder Social home page Coder Social logo

chadzilla2080 / whats-new-in-rails-4.1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jgorset/whats-new-in-rails-4.1

0.0 1.0 0.0 164 KB

My talk on Rails 4.1 for Hyper's Ruby meetup

Ruby 75.09% JavaScript 2.41% CoffeeScript 0.77% CSS 3.11% HTML 18.62%

whats-new-in-rails-4.1's Introduction

What's new in Rails 4.1?

Spring

  • Makes running your console, rake tasks and mostly everything else super-fast.
  • Sort of like spork and zeus!
  • Except better!
  • Spork: Lots of awkward setup.
  • Zeus: You need to run it.
  • With Spring, all you have to do is use Rails' binstubs. Add ./bin to your $PATH. Beautiful.
  • Bonus! No more bundle exec!

Secrets

  • New file config/secrets.yml for your sensitive data.
  • By default it just contains Rails' own secret key, but you should put all your secret things in here.
  • Presumably supposed to be secret... yet version controlled.
  • As @espenhogbakk will tell you, version controlling your passwords is a bad thing.
- "Hey guys, we made this new file where you can put all your passwords instead of in config/application.rb!"
- "Awesome! Now we don't have to version control our passwords anymore!"
- "About that..."
  • ... wat?

Action Pack Variants

  • Render different views or even behave differently for phones, tablets and desktop browsers!
  • Awesome. No more hacks where you make a format called "iPhone". "iPhone" is not a format.
  • Define variants in before actions (example in app/controllers/application_controller.rb).
  • Use them in respond_to in controller actions (example in app/controllers/home_controller.rb).

ActionMailer Previews

  • ActionMailer. Previews.
  • Previews. For ActionMailer.
  • Awesome.
  • Sort of like LetterOpener and MailPreview.
  • In fact, exactly like LetterOpener and MailPreview.
  • Create previews in test/mailers/previews (example in test/mailers/previews/user_mailer_preview.rb).
  • If you use rspec, you can customize where they live so you can put them in spec or whatever.
  • Navigate to http://localhost:3000/rails/mailers/user_mailer to preview.

ActiveRecord enums

  • Sort of like enumerize!
  • In fact, exactly like enumerize!
  • Except different.
  • The good: Faster! Probably. It stores integers instead of strings. You won't notice.
  • The bad: It's going to get ugly if you remove options.

whats-new-in-rails-4.1's People

Contributors

jgorset avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.