This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| class ApplicationController < ActionController::Base | |
| ... | |
| # FORCE to implement content_for in controller | |
| def view_context | |
| super.tap do |view| | |
| (@_content_for || {}).each do |name,content| | |
| view.content_for name, content | |
| end | |
| end | |
| end | 
| class ApplicationController < ActionController::Base | |
| # ... | |
| unless Rails.application.config.consider_all_requests_local | |
| rescue_from Exception, with: lambda { |exception| render_error 500, exception } | |
| rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception } | |
| end | |
| private | |
| def render_error(status, exception) | 
| <!-- /app/views/admin/users/new_invitiations.html.erb --> | |
| <h2>Send invitation</h2> | |
| <%= form_for @user, :url => send_invitation_admin_users_path do |f| %> | |
| <table style='width: 50%'> | |
| <tr> | |
| <td><%= f.label :first_name %></td> | |
| <td><%= f.text_field :first_name %></td> | 
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console | 
##Reactive System Design Links
#Articles and Papers
| /* | |
| Tools: mocha, chai-enzyme, jsdom, airbnb enzyme | |
| Using WebStorm test runner and WebStorm to write code. | |
| For the prod code, using Flow for type checking | |
| These are isolated unit tests (not integration) that test behavior for particular React components | |
| A big reason why I like React.js vs Vue, Angular, or other types of frameworks or | |
| libraries is the simplicity at which you can test behavior. Also there's no magic going on here in terms of |