# meta tags para a lista de produtos %> <% end %> <% # app/views/products/show.html.erb %> <% content_for :head do %> <% # meta tags para um produto %> <% end %>
added to an individual object, (..), without affecting the behavior of other objects from the same class.” http://en.wikipedia.org/wiki/Decorator_pattern
act upon various models or the data in the database needs to be manipulated in various ways before it is displayed in the view.” Jay Fields - http://blog.jayfields.com/2007/03/rails-presenter-pattern.html
in your templates and out of your helpers.” Ryan Singer - "What belongs in a helper method?" http://37signals.com/svn/posts/1108-what-belongs-in-a-helper-method
irrelevant to your template, or when they allow you to abstract common template code to avoid repetition” Ryan Singer - "What belongs in a helper method?" http://37signals.com/svn/posts/1108-what-belongs-in-a-helper-method
a helper, think twice and try to keep as much HTML in your template as possible.” Ryan Singer - "What belongs in a helper method?" http://37signals.com/svn/posts/1108-what-belongs-in-a-helper-method
'text/event-stream' loop do response.stream.write 'data: WHATSUP!\n\n' sleep 5 end rescue IOError # Connection closed ensure response.stream.close end end ActionController::Live
just a simple header. You don't need any separate libraries; a simple before filter should do.” https://github.com/blog/1477-content-security-policy class ApplicationController < ActionController::Base before_filter :set_csp def set_csp response.headers['Content-Security-Policy'] = "default-src *; script-src https://assets.example.com; style-src https:// assets.example.com" end end